(a) Outline the steps involved in creating the Query By Example (QBE) in figure 1 assuming the table customer exist already. Figure 1 (b) Write the steps to...
(a) Outline the steps involved in creating the Query By Example (QBE) in figure 1 assuming the table customer exist already.
Figure 1
(b) Write the steps to generate the SQL statement for the action in 4 (a).
a) Steps involved in creating a Query By Example (QBE) in Figure 1:
Open a database management software and connect to the database where the "customer" table exists.
Open the "customer" table and select the columns you want to include in the query results. In Figure 1, the columns selected are "First Name," "Last Name," and "City."
Specify the conditions for the query. In Figure 1, the condition is "City = 'London'."
Run the query by clicking the "Run" or "Execute" button in the software.
b) Steps to generate the SQL statement for the action in 4 (a):
Start the statement with "SELECT" to indicate that you want to retrieve data from the table.
List the column names you want to include in the query results, separated by commas. In Figure 1, the columns are "First Name," "Last Name," and "City."
Add the "FROM" clause to specify the table you want to retrieve data from. In this case, the table is "customer."
Add the "WHERE" clause to specify the conditions for the query. In Figure 1, the condition is "City = 'London'."
End the statement with a semicolon (;) to indicate the end of the statement.
The final SQL statement for the action in 4 (a) would look like this:
SELECT First Name, Last Name, City
FROM customer
WHERE City = 'London';
a) Steps involved in creating a Query By Example (QBE) in Figure 1:
Open a database management software and connect to the database where the "customer" table exists.
Open the "customer" table and select the columns you want to include in the query results. In Figure 1, the columns selected are "First Name," "Last Name," and "City."
Specify the conditions for the query. In Figure 1, the condition is "City = 'London'."
Run the query by clicking the "Run" or "Execute" button in the software.
b) Steps to generate the SQL statement for the action in 4 (a):
Start the statement with "SELECT" to indicate that you want to retrieve data from the table.
List the column names you want to include in the query results, separated by commas. In Figure 1, the columns are "First Name," "Last Name," and "City."
Add the "FROM" clause to specify the table you want to retrieve data from. In this case, the table is "customer."
Add the "WHERE" clause to specify the conditions for the query. In Figure 1, the condition is "City = 'London'."
End the statement with a semicolon (;) to indicate the end of the statement.
The final SQL statement for the action in 4 (a) would look like this:
SELECT First Name, Last Name, City
FROM customer
WHERE City = 'London';