Detail Form
We will send your result on your email id and phone no. please fill detail
You have two tables called Employee and Department.
Employee
Field | Type |
---|---|
EmployeeId | int |
EmployeeName | text |
DepartmentId | int |
Department
Field | Type |
---|---|
DepartmentId | int |
DepartmentName | text |
Sample:
Employee
EmployeeId | EmployeeName | departmentId |
---|---|---|
1 | Mark | 1 |
2 | John | 1 |
3 | Mike | 1 |
4 | Mary | 2 |
5 | Stacy | 2 |
Sample:
Department
DepartmentId | DepartmentName |
---|---|
1 | IT |
2 | HR |
3 | Payroll |
4 | Admin |
Sample Output
DepartmentName | EmployeeName |
---|---|
IT | Mark |
IT | John |
IT | Mike |
HR | Mary |
HR | Stacy |
Using the Employee and Department tables, which of the following queries will return the same sample output?
1. select DepartmentName,EmployeeName from Employee JOIN Department onDepartments.DepartmentId=EmployeeId.DepartmentId;
2. select DepartmentName,EmployeeName from Employee LEFT JOIN Department onDepartments.DepartmentId=EmployeeId.DepartmentId;
3. select DepartmentName,EmployeeName from Employee RIGHT JOIN Department onDepartments.DepartmentId=EmployeeId.DepartmentId;
In an SQL Server, which of the following queries will you use to get the list of all the employees working in any department along with all those who are not assigned to any department?
EMP_ID | User_name | F_Name | L_name | Dep_ID |
1 | AAlice | Alice | Smith | 1 |
2 | BBob | Bob | Jones | 1 |
3 | BBen | Ben | Johnson | 2 |
4 | MMike | Mike | White | 2 |
5 | AAnita | Anita | Williams | 3 |
6 | LLisa | Lisa | Davis | 3 |
7 | MMary | Mary | Brown | 4 |
8 | JJohn | John | Wilson | 4 |
Dep_ID | Dep_name |
1 | Technical Innovations |
2 | Technical Support |
3 | Operations |
4 | Customer Delight |
What will be the result of the following MySQL statements:
ΑLTER TΑBLE test_tbl DROP col1;
ΑLTER TΑBLE test_tbl ΑDD col1 INT ΑFTER col2;
What will be the result of the following MySQL query:
SELECT * FROM table_name WHERE col_1 = MAX(col_1);
In MySQL, which of the following is the correct syntax to modify the definition of an existing table?
In SQL, which of the following operations is equivalent to performing SELECT on a MERGE statement?
The following tables and dataset are created in the database:
CREATE TABLE students (st_id INT NOT NULL AUTO_INCREMENT, st_name VARCHAR(255), PRIMARY KEY (st_id) );
Consider the tables and data set, what will be the output when we the following SQL statement is executed?
INSERT INTO (issue_id, book_id) VALUES (1,2);
Table name: students
st_id | st_name |
1 | Alice |
2 | Bob |
3 | Ben |
4 | Mike |
5 | Tara |
6 | Anita |
7 | Lisa |
8 | Mary |
9 | John |
10 | Paul |
Table name: library_issue
lib_issue_id | st_id |
1 | 1 |
2 | 4 |
3 | 5 |
4 | 7 |
5 | 5 |
6 | 9 |
7 | 4 |
8 | 7 |
9 | 5 |
Table Name: books_library
book_id | book_name |
1 | Book1 |
2 | Book2 |
3 | Book3 |
4 | Book4 |
5 | Book5 |
6 | Book6 |
7 | Book7 |
8 | Book8 |
9 | Book9 |
Table Name: books_issue_students
lib_issue_id | book_id |
1 | 2 |
2 | 3 |
2 | 4 |
3 | 5 |
4 | 7 |
4 | 1 |
5 | 6 |
6 | 13 |
7 | 14 |
7 | 15 |
8 | 10 |
9 | 12 |
The following tables and data set is created in database:
CREATE TABLE students (st_id INT NOT NULL AUTO_INCREMENT, st_name VARCHAR(255), PRIMARY KEY (st_id) );
Consider the given tables and data set. How many records will be displayed when the following SQL query is executed?
SELECT library_issue.lib_issue_id, students.st_name FROM library_issue INNER JOIN students ON library_issue.st_id = students.st_id ORDER BY lib_issue.id;
Table name: students
st_id | st_name |
1 | Alice |
2 | Bob |
3 | Ben |
4 | Mike |
5 | Tara |
6 | Anita |
7 | Lisa |
8 | Mary |
9 | John |
10 | Paul |
Table name: library_issue
lib_issue_id | st_id |
1 | 1 |
2 | 4 |
3 | 5 |
4 | 7 |
5 | 5 |
6 | 9 |
7 | 4 |
8 | 7 |
9 | 5 |
Table Name: books_library
book_id | book_name |
1 | Book1 |
2 | Book2 |
3 | Book3 |
4 | Book4 |
5 | Book5 |
6 | Book6 |
7 | Book7 |
8 | Book8 |
9 | Book9 |
Table Name: books_issue_students
lib_issue_id | book_id |
1 | 2 |
2 | 3 |
2 | 4 |
3 | 5 |
4 | 7 |
4 | 1 |
5 | 6 |
6 | 13 |
7 | 14 |
7 | 15 |
8 | 10 |
9 | 12 |
In MySQL, which of the following returns all the databases whose names start with db
?
In MySQL, which of the following is not a column comparison operator?