Refine
All questions
351 resultsWrite an SQL query to retrieve names of teachers having at least 6 characters in the first name.
Show answer
Write an SQL query to list names of teachers in alphabetical order (by First_Name then Last_Name).
Show answer
Write an SQL query to list department names in descending alphabetical order.
Show answer
Write an SQL query to retrieve details of teachers whose Last_Name is NOT specified (NULL).
Show answer
Write a nested SQL query to retrieve the names of all departments having female teachers.
Show answer
Write an SQL query to find the total salary of all teachers.
Show answer
Write an SQL query to find the maximum and minimum salary among all teachers.
Show answer
Write an SQL query to count the number of teachers earning more than Rs 40000.
Show answer
Write an SQL query to display teacher names, current salary, and a 10 percent increased salary (as New_Salary) for teachers in department 4.
Show answer
Write an SQL query using GROUP BY to find the number of teachers in each department (Dept_No).
Show answer
Write an SQL query using GROUP BY and JOIN to find the number of teachers per department, showing department names.
Show answer
Write an SQL query using GROUP BY and HAVING to find departments having more than one teacher.
Show answer
Write an SQL query to update the salary of teacher with Teacher_ID = 101 to 55000.
Show answer
Write an SQL query to increase the salary of teacher named 'Shanaya' by 5000.
Show answer
Write an SQL query to delete the tuple for teacher with Teacher_ID = 101.
Show answer
Consider the Employee table (Employee_ID [PK], Employee_Name, Job_Title, Salary, Bonus, Age, Manager_ID [FK referencing Employee_ID]): Write SQL commands to (a) create the table (b) delete the employee with Employee_ID 1217 (c) update the salary of 'Amyra' to 40000.
Show answer
For the same Employee table, write SQL queries to: (a) display names and salaries of employees whose salary is greater than 20000 (b) display details of employees who are not getting any bonus (c) display names of employees whose name ends with the letter 'a' (d) display name and job title of employees whose Manager_ID is 1201.
Show answer
For the same Employee table, write SQL queries to: (a) display name and job title of employees whose manager is 'Amyra' (using a self-join/nested query) (b) display name and job title of employees aged between 26 and 30 years (both inclusive).
Show answer
A Railway company has tables Machine(Machine_ID [PK, CHAR(3)], Station [CHAR(30)]) and Sales(Machine_ID [CHAR(3)], Date, Tickets_Sold [INTEGER], Income [DECIMAL(8,2)]), with Machine_ID+Date as the key of Sales. Write SQL queries to: (a) find the number of ticket machines in each station (b) find the total ticket income of station 'New Delhi' for each day (c) find the total tickets sold by machine with Machine_ID = 122 till date.
Show answer
An application accessed via a web browser over a network connection is called a: