
Concept explainers
Define the following terms: Dynamic SQL, Correlated subquery, embedded SQL, procedure, join, equi-join, self-join, outer join, function, and persistent stored modules (SQL/PSM).

Explanation of Solution
Dynamic SQL: Dynamic SQL is the
Correlated subquery: In SQL correlated subquery is subquery in which the processing of inner query depends on the outer query. While in a normal nested query the inner query is executed first and then the outer query is executed, in case of correlated query inner query is executed once for each row considered by outer query.
Embedded SQL: Embedded SQL is the practice of combining the capability to programming languages and SQL statements to perform
Procedure: An SQL procedure is the stored SQL code containing multiple SQL statements which can be reused over and over again to perform some redundant task in the database.
Join: An SQL join refers to combination or two or more rows or columns from one or more tables in the database to create a temporary table. There are various kind joins such as equi join, self join, natural join, outer join, inner join etc.
Equi-join: It is a type of join in which the condition of joining is based on the equality between the values in common columns. Common columns are redundant in the resulting table in case of equi-join. For illustration purpose, consider the table below:
Table order | |
CustID | OrderID |
100 | 502 |
101 | 206 |
102 | 205 |
103 | 1225 |
Table customer | |
CustID | CustName |
100 | John |
101 | Paul |
102 | Smith |
103 | Jason |
For the above two tables on performing the equi join by the following SQL query:
SELECT Customer.CustID, Order.CustID,
CustName, OrderID
FROM Customer, Order
WHERE Customer.CustID = Order. CustID
ORDER BY OrderID
The resulting table will contain the following data:
CustID | CustID | CustName | OrderID |
100 | 100 | John | 502 |
101 | 101 | Paul | 206 |
102 | 102 | Smith | 205 |
103 | 103 | Jason | 1225 |
Self-join: Self-join is the join in which table rows are matched with other rows of the same table. In short self-join can be termed as joining the table with itself. Self-join can be used to generate a sub table from a given large table. The syntax for performing self-join is as follows:
SELECT B1.column_name, B2.column_name...
FROM table1 X, table1 Y
WHERE B1.common_filed = B2.common_field;
Outer join: It is a join in which resulting table consists of matching rows from the joined table as well as non-matching rows based on the join condition. The syntax of using outer join is as follows:
Select *
FROM table1, table2
WHERE conditions [+];
Function: A function in SQL is a stored subroutine that takes one parameter as input and returns one value. They are similar to procedure except that they can only exercise one input parameter. There are many built in functions in SQL such as SUM, AVG, and COUNT.
Persistent stored modules (SQL/PSM): PSM or persistent stored module is the additional capability added in the SQL in 1999. These capabilities allowed programmer to create and drop modules of codes stored in the database schema across user session. It also gave SQL computational power and flow control capabilities such as IF-THEN, FOR, WHILE statements and loops.
Want to see more full solutions like this?
Chapter 7 Solutions
Modern Database Management (12th Edition)
- 3) Find CFGs that for these regular languages over the alphabet Σ= {a, b}. Draw a Finite Automata e CFG. 1 COIS-3050H-R-W01-2025WI-COMB Formal anguages & Automata Is that contain the substring aba. (b) The language of all words that have an odd number letters and contains the string bb. (c) The language of all words that begin with the substring ba and contains an odd number of letters. 4) Convert the following FA into a PDA. a a S± b a a Ν Ꮓarrow_forwardCOIS-3050H-R-W01-2025WI-COMB Formal ministic PDA. Are the following words accepted by this Languages & Automata UI MIUSɩ that aTU I ed, indicate which state the PDA is in when the crash occurs. (a) aabbaa (b) aaabab (c) bababa Start (d) aaaabb A Accept Read₁ Push a (e) aaaaaa a b Read, Popi a a,b A Read₂ Accept A Pop₂arrow_forward5) Eliminate the A-productions from the following CFG: Abc COIS-3050H-R-W01-2025WI-COMB Formal Languages & Automata BAabC C CaA | Bc | A 6) Convert the following CFG into CNF. S→ XYZ XaXbS | a |A YSbS | X | bb Z→ barrow_forward
- Need help answering these questions!1. Design a While loop that lets the user enter a number. The number should be multiplied by 10, and the result stored in a variable named product. The loop should iterate as long as the product contains a value less than 100. 2. Design a For loop that displays the following set of numbers: 0, 10, 20, 30, 40, 50 . . . 1000 3. Convert the While loop in the following code to a Do-While loop: Declare Integer x = 1 While x > 0 Display "Enter a number." Input x End Whilearrow_forwardNeed help with these:Design a While loop that lets the user enter a number. The number should be multiplied by 10, and the result stored in a variable named product. The loop should iterate as long as the product contains a value less than 100. 2. Design a For loop that displays the following set of numbers: 0, 10, 20, 30, 40, 50 . . . 1000 3. Convert the While loop in the following code to a Do-While loop: Declare Integer x = 1 While x > 0 Display "Enter a number." Input x End Whilearrow_forwardConvert the While loop in the following code to a Do-While loop: Declare Integer x = 1 While x > 0 Display "Enter a number." Input x End Whilearrow_forward
- Python - need help creating a python program that will sum the digits of a number entered by the user. For example if the user inputs the value 243 the program will output 9 because 2 + 4 + 3 = 9. The program should ask for a single integer from the user, it should then calculate the sum of all the digits of that number and output the result.arrow_forwardI need help with this in Python (with flowchart): Im creating a reverse guessing game. Then to choose a random number from 1 to 100 and the computer program will attempt to guess it, displaying the directions calculated or not. The guess will be displayed and the user will answer if it was correct or not. If correct, the game ends, if not then the computer asks if the guess was too high or too low. Finally inputting an answer and the computer generates a new guess within the proper range. Oh and to make sure the program doesnt guess outside of the ranges produced by the inputs of “too high” and “too low”. The program ending when the user guesses correctly or after the program takes 6 guesses. HELP ASAP!arrow_forwardI need help with this in Python (with flowchart): Im creating a reverse guessing game. Then to choose a random number from 1 to 100 and the computer program will attempt to guess it, displaying the directions calculated or not. The guess will be displayed and the user will answer if it was correct or not. If correct, the game ends, if not then the computer asks if the guess was too high or too low. Finally inputting an answer and the computer generates a new guess within the proper range. Oh and to make sure the program doesnt guess outside of the ranges produced by the inputs of “too high” and “too low”. The program ending when the user guesses correctly or after the program takes 6 guesses. HELP ASAP!arrow_forward
- Need help finding errors in my pseudocode (Two)! Declare Boolean finished = False Declare Integer value, cube While NOT finished Display "Enter a value to be cubed." Input value; Set cube = value^3 Display value, " cubed is ", cube End While Next, I intended the following pseudocode to display the numbers 1 through 60, and then display the message "Time’s up!". Doesnt work and has error. Declare Integer counter = 1 Const Integer TIME_LIMIT = 60 While counter < TIME_LIMIT Display counter Set counter = counter + 1 End While Display "Time's up!"arrow_forwardHaving error in pseudcode; wanting to get five sets of two numbers each, calculate the sum of each set, and calculate the sum of all the numbers entered. Not functioning as intended and can't find the error.Code: // This program calculates the sum of five sets of two numbers. Declare Integer number, sum, total Declare Integer sets, numbers Constant Integer MAX_SETS = 5 Constant Integer MAX_NUMBERS = 2 Set sum = 0; Set total = 0; For sets = 1 To MAX_NUMBERS For numbers = 1 To MAX_SETS Display "Enter number ", numbers, " of set ", sets, "." Input number; Set sum = sum + number End For Display "The sum of set ", sets, " is ", sum "." Set total = total + sum Set sum = 0 End For Display "The total of all the sets is ", total, "."arrow_forwardNeed help converting loops!1. Convert the following While loop to a For loop: Declare Integer count = 0 While count < 50 Display "The count is ", count Set count = count + 1 End While _________________________________________________ 2. Convert the following For loop to a While loop: Declare Integer count For count = 1 To 50 Display count End Forarrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education





