Database Design and SQL Fundamentals Quiz, Exams of Computer Science

A series of multiple-choice questions focused on database design and normalization principles, covering topics such as sql commands, primary and foreign keys, data models, and referential integrity. It serves as a quiz or set of exercises to test understanding of database concepts and sql syntax. The questions cover a range of topics, including sql commands for data manipulation (select, insert, update, delete), key concepts like primary and foreign keys, data modeling, and referential integrity. Designed to assess and reinforce knowledge of database design and sql querying, making it a useful resource for students and professionals in computer science and database administration. It provides a structured way to test and improve understanding of database concepts and sql syntax.

Typology: Exams

2024/2025

Available from 08/12/2025

Prof.Henshall
Prof.Henshall ๐Ÿ‡ฌ๐Ÿ‡ง

1.1K documents

1 / 13

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Database Design and Normalization:
Principles and Practices
1. What does a table in a database represent?
oโœ“ A collection of rows and columns
oA single data entry
oA list of commands
oA programming language
2. In a table, what is a row called?
oโœ“ A record
oA column
oA key
oA field
3. What is a column in a database table?
oโœ“ A set of data values of a particular type
oA single data entry
oA list of rows
oA relation
4. Which SQL command is used to retrieve data?
oโœ“ SELECT
oINSERT
oUPDATE
oDELETE
pf3
pf4
pf5
pf8
pf9
pfa
pfd

Partial preview of the text

Download Database Design and SQL Fundamentals Quiz and more Exams Computer Science in PDF only on Docsity!

Database Design and Normalization:

Principles and Practices

  1. What does a table in a database represent? o โœ“ A collection of rows and columns o A single data entry o A list of commands o A programming language
  2. In a table, what is a row called? o โœ“ A record o A column o A key o A field
  3. What is a column in a database table? o โœ“ A set of data values of a particular type o A single data entry o A list of rows o A relation
  4. Which SQL command is used to retrieve data? o โœ“ SELECT o INSERT o UPDATE o DELETE
  1. Which SQL command adds new data to a table? o SELECT o โœ“ INSERT o UPDATE o DELETE
  2. Which SQL command changes existing data in a table? o SELECT o INSERT o โœ“ UPDATE o DELETE
  3. Which SQL command removes data from a table? o SELECT o INSERT o UPDATE o โœ“ DELETE
  4. What uniquely identifies a record in a database table? o A foreign key o โœ“ A primary key o A column name o An index
  5. What links two tables in a relational database?
  1. What is the difference between a primary key and a foreign key? o Both are the same o Primary key identifies rows, foreign key relates tables โœ“ o Primary key relates tables, foreign key identifies rows o Neither has a specific function
  2. Which command updates the age of employee โ€˜Johnโ€™ to 31? o UPDATE Employees SET Age = 31 WHERE Name = 'John'; โœ“ o INSERT INTO Employees (Age) VALUES (31) WHERE Name = 'John'; o SELECT Age = 31 FROM Employees WHERE Name = 'John'; o DELETE Age FROM Employees WHERE Name = 'John';
  3. How do you delete all records from a table named "Orders"? o DELETE * Orders; o โœ“ DELETE FROM Orders; o REMOVE FROM Orders; o DELETE Records FROM Orders;
  4. What does the term โ€œdata modelโ€ refer to in databases?

o A programming language o A software interface o โœ“ A way to organize data into tables, rows, and columns o A type of database engine

  1. Which of the following best describes a "row"? o A column header o โœ“ A single entry in a table o A database itself o A key column
  2. An attribute in a database corresponds to which element? o Row o โœ“ Column o Table o Record
  3. Which SQL command would you use to add a new column to an existing table? o INSERT COLUMN o UPDATE COLUMN o โœ“ ALTER TABLE o SELECT COLUMN
  4. When writing an SQL SELECT query, which clause filters the records?

o โœ“ Must reference a primary key in another table o Always a number o Must be a text field

  1. Which command is used to change data in an existing row? o โœ“ UPDATE o INSERT o DELETE o MODIFY
  2. How do you retrieve only the "Name" column from a table named "Users"? o SELECT USERS.Name; o SELECT COLUMN Name FROM Users; o โœ“ SELECT Name FROM Users; o GET Name FROM Users;
  3. Consider two tables: Orders (OrderID, CustomerID) and Customers (CustomerID, Name). What is CustomerID in Orders? o Primary key o โœ“ Foreign key o Unique key o Index
  4. What is the purpose of the WHERE clause in SQL?

o To select tables o To join tables o โœ“ To filter records based on a condition o To order results

  1. In SQL, which command would add a new row to a table? o UPDATE o DELETE o SELECT o โœ“ INSERT
  2. What is a composite key? o A single primary key o A foreign key o โœ“ A primary key made up of multiple columns o A key used only for sorting
  3. Which SQL statement would update the salary of employees in department 5? o UPDATE Employees SET Salary=5000; o โœ“ UPDATE Employees SET Salary=5000 WHERE DepartmentID=5; o INSERT Salary=5000 WHERE DepartmentID=5; o DELETE Salary FROM Employees WHERE DepartmentID=5;
  4. How do you remove a column from a table?

o A property of stored procedures o โœ“ Ensures foreign keys correctly reference primary keys o The speed of query execution o The uniqueness of primary keys

  1. Can a table have more than one foreign key? o No o โœ“ Yes o Only if it has no primary key o Only in NoSQL databases
  2. What result does the following SQL produce? SELECT Name FROM Employees WHERE Age > 30; o โœ“ Returns names of employees older than 30 o Returns all names o Returns ages of employees o Throws an error
  3. In a SQL database, what is a โ€œrecordโ€? o A column in a table o โœ“ A row of data in a table o A type of data model o An SQL command
  4. What is the function of the PRIMARY KEY constraint? o Allows duplicate values

o โœ“ Uniquely identifies each row in a table o References other tables o Sorts data

  1. Which statement correctly deletes a record with ID=10 from a table called Products? o DELETE Products WHERE ID=10; o DELETE * FROM Products WHERE ID=10; o โœ“ DELETE FROM Products WHERE ID=10; o REMOVE FROM Products WHERE ID=10;
  2. What does the SQL INSERT INTO statement do? o Deletes data o โœ“ Adds new data to a table o Retrieves data o Updates data
  3. What is the keyword to change existing data? o INSERT o DELETE o โœ“ UPDATE o SELECT
  4. Which of the following describes a foreign key? o A key unique to the table o โœ“ A field that points to a primary key in another table

o ORDER BY o GROUP BY o HAVING

  1. A primary key must have which of the following characteristics? o Allows duplicates o Can be NULL o โœ“ Unique and not NULL o Optional in tables
  2. Why use foreign keys? o To speed up queries o To sort data o โœ“ To maintain relationships between tables o To duplicate data