SQL Fundamentals · Practice set 1 of 5
SQL and Relational Databases: 10 practice questions
10 free SQL Fundamentals practice questions on SQL and Relational Databases, with an explanation for every answer. Untimed. The full mock exam and the timed version are in the app.
-
Question 1 of 10
The artist name is stored once in artists, and each row of albums keeps only the artist number. The artist Accept, with two albums, changes its name. How many stored rows hold that name and have to be edited?
- AThree rows: one in artists and one per album
- BTwo rows, one for each of its albums
- COne row, in artists
- DNo row, because the name is rebuilt from the album titles
Show the answer
This design keeps the fact in one place, so the name is edited in the single artists row that holds it.
Next → 1 / 10 -
Question 2 of 10
The tracks table holds For Those About To Rock at 0.99, Fast As a Shark at 0.99, Walk On Water at 1.29 and All I Really Want at 1.29. Which names does SELECT name FROM tracks WHERE unit_price > 0.99 ORDER BY name return, and in which order?
- AAll I Really Want, then Walk On Water
- BThe four track names, sorted by name
- CFast As a Shark, then For Those About To Rock
- DWalk On Water, then All I Really Want
Show the answer
Two tracks cost more than 0.99, and the last line sorts the result by name, so All I Really Want is printed first.
Next → 2 / 10 -
Question 3 of 10
Why can one plain SELECT statement be sent to PostgreSQL, to MySQL, to SQL Server or to SQLite and bring back the same rows?
- AThe four products keep their tables in one shared storage file
- BEach product copies its own tables into the other three
- CSQL is a standardized language, and the four products implement it
- DThe operating system rewrites the statement for each product
Show the answer
SQL is defined by an international standard, so the shared core of the language reads the same in the four products.
Next → 3 / 10 -
Question 4 of 10
A colleague says that SQL Server is simply another name for the SQL language. Following what its own documentation says, what is the correction?
- AIt is a single query statement that is kept on a server
- BIt is a relational database management system, not the language
- CIt is the name of a table type that applications create
- DIt is the published SQL standard, sold with a support contract
Show the answer
SQL Server is a relational database management system: software that stores the data and carries out the statements sent to it.
Next → 4 / 10 -
Question 5 of 10
PostgreSQL states that it conforms to at least 170 of the 177 mandatory core features of the SQL standard, and also that no relational database reaches full conformance. What does that pair of statements mean for the SQL you write?
- AAll of it travels, so nothing has to be checked again
- BNone of it travels, so each product has to be learned apart
- CIt travels only between products of the same company
- DMost of it travels, and the unusual parts are worth checking
Show the answer
Broad conformance is why the core reads the same everywhere, and the missing part is why an unusual feature deserves a look at the documentation.
Next → 5 / 10 -
Keep the ones you got wrong
In the app, every question you miss comes back exactly when you’re about to forget it.
Opens in your browser. Nothing to install.
Start studying -
Question 6 of 10
The albums table has album_id, title and artist_id, and the artist name lives in artists. A report has to list the titles of artist 2, but someone wrote SELECT title FROM albums WHERE name = 'Accept'. What is the smallest sound fix?
- AFilter on artist_id 2, the value albums actually stores
- BDrop the condition and report the four album titles instead
- CRename the title column of albums to name so it matches
- DCopy the artist name into a new column of every album row
Show the answer
The albums table keeps the artist number and not the artist name, so the condition has to be written on the column that is there.
Next → 6 / 10 -
Question 7 of 10
The albums table holds For Those About To Rock and Let There Be Rock with artist_id 1, and Balls to the Wall and Restless and Wild with artist_id 2. What does SELECT title FROM albums WHERE artist_id = 1 return?
- AThe four album titles, because every album belongs to an artist
- BTwo rows holding the number 1, once for each album found
- CTwo titles: For Those About To Rock and Let There Be Rock
- DOne title: the first album row of the table
Show the answer
Two album rows carry the number 1, and the select list asks for the title of each of them.
Next → 7 / 10 -
Question 8 of 10
An application connects to a SQL Server database and sends it commands. According to that product's own documentation, what is the language of that conversation called?
- AA command language supplied by the operating system
- BTransact-SQL, a dialect of that product
- CThe SQL standard exactly, with nothing added to it
- DA private format that no documentation describes
Show the answer
Applications and tools connect to SQL Server and communicate with it in Transact-SQL.
Next → 8 / 10 -
Question 9 of 10
A colleague keeps a text file of SELECT statements on a laptop and calls that file their database. What is the correction?
- AThe file is the database system, and its tables are the language
- BThe file becomes the database once it is copied to a server
- CNothing to correct: a set of statements is a database
- DThe file holds SQL text; a database system holds the data
Show the answer
SQL is text that asks for work; the data itself lives in the product that stores it and carries the statements out.
Next → 9 / 10 -
Question 10 of 10
A report uses SELECT title FROM albums WHERE artist_id = 2, plus a second statement that uses a data type the product documents among its own additions. Both must run on another family. What is the sound expectation?
- ANeither travels: a script written for one product is lost
- BThe extra type travels, while plain statements stay behind
- CThe SELECT travels; the extra type is the part to check
- DBoth travel with no review at all, since the four read SQL
Show the answer
Plain SQL is the shared core that the four products read, and the added type is what the other product may not offer.
Next → 10 / 10 -
You’ve finished this set
That’s 10 questions on SQL and Relational Databases. In the app the ones you miss come back exactly when you’re about to forget them.
Back to the course Next lesson: Database Structure and Core VocabularyOpens in your browser. Nothing to install.
Start studying
The whole course, on your computer and your phone
Lessons you can read, audio you can listen to on the way to work, and practice that remembers what you got wrong.
Opens in your browser. Nothing to install.
Start studying“This app is the ‘One Lake’ for preparing the certification exams. Really worth it.”
