178 Answered Questions for the topic SQL

Sql

04/26/22

How to select a subject has an empty class

I has 3 TableStudentidclass_idClassclass_idsubject_idclass_nameSubjectsubject_idsubject_nameHow can I select the subject have an empty class ( 1 subject can have many class)

Write an SQL script to create a table called users in a database

Write an SQL script to create a table called users in a database, with the following fields (assume the specific database has already been accessed) a.id, which is the primary key and value is... more
Sql

01/25/22

3) Write a SQL Function that get the high number from two inputs (a and b); the result should be 1 ifa > b else 0

Write a SQL Function that get the high number from two inputs (a and b); the result should be 1 ifa > b else 0
Sql

01/02/22

find the total comment and last comment against serviceid

create table ServiceComment(ServiceID int,CommentDate Date,CommentDetails varchar(200));insert into ServiceComment values(1001,'2021-11-15','Test Comment1.1')insert into ServiceComment... more
Sql

12/17/21

Optimize the execution plan of the following query using rule-based optimization

Optimize the execution plan of the following query using rule-based optimization. SELECT P.number, D.num, E.lnameFROM EMPLOYEE E, DEPARTMENT D, PROJECT PWHERE P.location = ‘Dammam’ AND E.sex = ‘M’... more
Sql Database

11/24/21

Creating a ERD Diagram using UML notation

A student may register for many subjects and a subject is registered by many students.A student’s number, name and age needs to be stored in the database.Each subject’s code, name, duration, cost... more
Sql

11/16/21

SQL-Structured Query Language

Consider the Following Table Employee(emp_id, name,dept_id, email, mobile_number, join_date,salary, mgr_id) 1) Query to display the name and salary for all the employees whose salary is not in the... more
Sql

10/10/21

SQL employee database question

Find all the employees salary records where the salary amount is greater than his/her average salary. Display employee's first name, last name, salary amount, from and to date.

Database/SQL Question HELP ASAP!

Use HR Database Write the SQL in Transact SQL Question: Return all the locations that are in countries with multiple locations. For example, if Canada has 2 locations, then I need to return these... more

Database/SQL Question HELP ASAP!

Use HR Database Write the SQL in Transact SQL Question: Return the employee that have salary that is not in the range between the minimum salary and maximum salary of their job. For example, you... more

Database/SQL Question HELP ASAP!!

Use HR Database Write the SQL in Transact SQL Question: how to write an SQL statement to Return the name of the employees who manage more than 3 employees.

NEED HELP ASAP!!

Use HR Database Write the SQL in Transact SQL Question: How to write an SQL statement to Return the name of the manager of Finance Department.

NEED HELP ASAP!!

Use HR Database Write the SQL in Transact SQL Question 1: How to write an SQL statement to Return all the country names and the name of their Regions.

NEED HELP ASAP!!!

Use HR database for this assignment. Number each of the statements Write SQL statement:1. Return all the country names and the name of their Regions. 2. Return the name of the manager of Finance... more
Sql

05/21/21

What is the most important role of the primary unique key?

To keep each rows in the table unique To keep each row in the table secure To define the first row of the table To stop the same columns name being used in more than one table
Sql

05/21/21

Which of the following statements is true ?

It is not compulsory to have a 'where' statement in every query A 'where' condition is required in every query so that the database will know where to get the data for the resulting report A... more
Sql

05/21/21

Which symbols are used as wild cards when searching for a string in a column?

%_ [] &_ [] &_ {} %_ {}
Sql

05/21/21

To remove duplicate rows from results of an SQL SELECT statement , the ..... qualifier specified must be included.

Distinct Only Unique Aggregate
Sql

04/15/21

Why would you use a 'DISTINCT' clause in a query?

To remove rows when some of the data in the columns is duplicated To remove any null values from the report To sort reports in a distinctive order To prevent duplicates rows appearing on the... more
Sql

04/15/21

What does an alias do when coded in the 'front' statement?

Renames columns so they can be used in the 'group by' and 'order by' statements with more readable names Renames columns so they can be used in the 'where' and 'having=' statements to make the... more
Sql

04/15/21

When can a primary unique key contain a null value?

Never Always Sometimes, if the primary key is missing or not known Sometimes, if the entire row is missing or not known Which one
Sql

04/15/21

Null values are used when the values to be inserted is:

Already stored somewhere else, to reduce data redundancy Not Known or does not exist Equal to zero or spaces All of the above Which one

03/29/21

Why and how are join tables used?

SQL QUESTION W3schools

This is the database that i want to use, https://www.w3schools.com/sql/trysql.asp?filename=trysql_op_inFind the average price for all the products from the USA supplier.

03/17/21

Database SQL Question

using https://www.w3schools.com/sql/trysql.asp?filename=trysql_op_in, we want to find the number of products in the table Products (the table has 77 rows) that was sold to the USA customers. No... more

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.