SQL and Database Fundamentals
Test your knowledge of basic SQL queries, database concepts, and database management systems including SELECT, INSERT, UPDATE, DELETE statements and key constraints.
Questions
What does SQL stand for?
- Structured Query Language
- Strong Question Language
- Structured Question Language
- none of above
Which SQL statement is used to extract data from a database?
- OPEN
- GET
- SELECT
- EXTRACT
- Which SQL statement is used to delete data from a database?
- DELETE
- COLLAPSE
- REMOVE
- None
Which SQL statement is used to extract data from a database?
- OPEN
- GET
- SELECT
- EXTRACT
- Which SQL statement is used to update data in a database?
- SAVE
- SAVE AS
- MODIFY
- UPDATE
- Which SQL statement is used to insert new data in a database?
- INSERT NEW
- ADD RECORD
- ADD NEW
- INSERT INTO
- With SQL, how do you select all the columns from a table named "Persons"?
- SELECT Persons
- SELECT *.Persons
- SELECT * FROM Persons
- SELECT [all] FROM Persons
- With SQL, how do you select all the records from a table named "Persons" where the value of the column "FirstName" is "Peter"?
- SELECT * FROM Persons WHERE FirstName<>'Peter'
- SELECT [all] FROM Persons WHERE FirstName='Peter'
- SELECT * FROM Persons WHERE FirstName='Peter'
- SELECT [all] FROM Persons WHERE FirstName LIKE 'Peter'
- What does SQL stand for?
- Structured Query Language
- Strong Question Language
- Structured Question Language
- None
- With SQL, how do you select a column named "FirstName" from a table named "Persons"?
- SELECT Persons.FirstName
- SELECT FirstName FROM Persons
- EXTRACT FirstName FROM Persons
- None
Can Primary Key be Null?
- True
- False
Can Sec Key be Null?
- True
- False
Can Composite Key be Null?
- True
- False
OBject Relational Database have entity relations?
- True
- False
Is DB2 database managament system?
- True
- False
Which SQL keyword is used to sort the result-set?
- SORT BY
- SORT
- ORDER
- ORDER BY
How can you change "Hansen" into "Nilsen" in the "LastName" column in the Persons table?
- MODIFY Persons SET LastName='Nilsen' WHERE LastName='Hansen'
- MODIFY Persons SET LastName='Hansen' INTO LastName='Nilsen
- UPDATE Persons SET LastName='Hansen' INTO LastName='Nilsen'
- UPDATE Persons SET LastName='Nilsen' WHERE LastName='Hansen'
With SQL, how can you return the number of records in the "Persons" table?
- SELECT COUNT(*) FROM Persons
- SELECT COLUMNS(*) FROM Persons
- SELECT COLUMNS() FROM Persons
- SELECT COUNT() FROM Persons
With SQL, how do you select all the records from a table named "Persons" where the value of the column "FirstName" is "Peter"?
- SELECT [all] FROM Persons WHERE FirstName LIKE 'Peter'
- SELECT * FROM Persons WHERE FirstName<>'Peter'
- SELECT [all] FROM Persons WHERE FirstName='Peter'
- SELECT * FROM Persons WHERE FirstName='Peter'
With SQL, how do you select all the records from a table named "Persons" where the value of the column "FirstName" starts with an "a"?
- SELECT * FROM Persons WHERE FirstName LIKE '%a'
- SELECT * FROM Persons WHERE FirstName='%a%'
- SELECT * FROM Persons WHERE FirstName='a'
- SELECT * FROM Persons WHERE FirstName LIKE 'a%'