0% found this document useful (0 votes)
2 views1 page

SQLSample Questions

The document outlines a series of database schema modifications and queries. It includes adding foreign key and check constraints to various tables, ensuring data integrity and uniqueness, as well as retrieving specific employee and salary information through SQL queries. The document emphasizes the importance of enforcing constraints and performing data retrieval operations effectively.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views1 page

SQLSample Questions

The document outlines a series of database schema modifications and queries. It includes adding foreign key and check constraints to various tables, ensuring data integrity and uniqueness, as well as retrieving specific employee and salary information through SQL queries. The document emphasizes the importance of enforcing constraints and performing data retrieval operations effectively.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

1- Add a foreign key constraint on the DepartmentID in the Employees table that

references the DepartmentID in the Departments table.

2- Implement a foreign key constraint on the DepartmentID in the Projects table


that references the DepartmentID in the Departments table.

3- Create a foreign key relationship in the Attendance table for the EmployeeID
that references the EmployeeID in the Employees table.

4- Establish a foreign key constraint in the Salaries table for the EmployeeID that
references the EmployeeID in the Employees table.

5- Add a check constraint to the Projects table to ensure that the Budget value is
greater than zero.

6- Create a check constraint in the Salaries table to enforce that the BaseSalary
falls between 30,000 and 200,000.

7- Implement a check constraint in the Attendance table to ensure that CheckOutTime


is greater than CheckInTime.

8- Add a unique constraint to the EMAIL field in the Employees table to ensure
email addresses are unique.

9- Establish a unique constraint on the Phone field in the Employees table to


ensure that phone numbers are unique.

10- Retrieve the average value of the Bonus field from the Salaries table.

11- display the first names, last names, and department names of employees in the
'Quality Assurance' department

12- display the Employees table for records where the FIRSTName consists of exactly
four letters.

13- Select records from the Employees table where the FIRSTName starts with the
letter 'A'.

14- Retrieve the full names, department names, and check-in times of employees who
checked in after 8:30 AM on October 24, 2023

15- Count the number of employees who checked in after 8:30 AM on October 24, 2023

16- Calculate the total BaseSalary and Bonus from the Salaries table.

17- Select locations from the Departments table without duplication.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy