Database Concepts (8th Edition)
8th Edition
ISBN: 9780134601533
Author: David M. Kroenke, David J. Auer, Scott L. Vandenberg, Robert C. Yoder
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Concept explainers
Question
Chapter 3, Problem 3.30RQ
Program Plan Intro
Table Creation:
Creating table comes under Data Definition Language (DDL).
The Syntax for creating table is as follows:
CREATE TABLE TABLE_NAME (
Column1 datatype,
Column2 datatype,
…
);
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
Database: https://www.w3schools.com/sql/trysql.asp?filename=trysql_select_all
SBN Title Author 12345678 The Hobbit J.R.R. Tolkien 45678912 DaVinci Code Dan Brown Your student ID DBS311 Your Name
use the following statement to Write a PL/SQL Function that accepts 4 parameters, 2 strings representing students names, and 2 integers representing the marks they received in DBS311. The function will determine which student had the higher mark and return the name of the student. If the marks were the same, then return the word "same" and return "error" if an error occurs or the calculation can not be determined.
Use SQL Developer or Oracle Live SQL to write the appropriate SQL commands as follows: A) FUNCTION: Use the region table to create a function called ‘Return_region_name’ which accepts an input parameter ‘region_id’, and print the name of the region with that id. Then execute this function with region_id = 1. [LAB-7] (3) B) PROCEDURE: Use the cust_node table to create a procedure called ‘Get_node_id’ that takes the cust_id as an input parameter to show its corresponding node id to the banker. Then execute this procedure with cust_id=5. [LAB-7] (2) C) Trigger: Create a row-level trigger called ‘Compute_Amount_trigger’ on the cust_txn table to automatically update the amount of withdraw transaction made after inserting or updating amount on the cust_txn table. Additionally, this trigger must show this statement ‘TRIGGER MESSAGE: The amount of cust_id and txn_type is modified successfully'. Then test your trigger by updating the cust_txn table. For example, update the amount of the…
Chapter 3 Solutions
Database Concepts (8th Edition)
Ch. 3 - Prob. 3.1RQCh. 3 - What is a data sublanguage?Ch. 3 - Prob. 3.3RQCh. 3 - Prob. 3.4RQCh. 3 - Prob. 3.5RQCh. 3 - Why do some standard SQL-92 statements fail to run...Ch. 3 - Use the following tables for your answers to...Ch. 3 - Write an SQL CREATE TABLE statement to create the...Ch. 3 - Prob. 3.9RQCh. 3 - Prob. 3.10RQ
Ch. 3 - Prob. 3.11RQCh. 3 - Is PET or PET_2 a better design? Explain your...Ch. 3 - Prob. 3.13RQCh. 3 - Prob. 3.14RQCh. 3 - Prob. 3.15RQCh. 3 - Prob. 3.16RQCh. 3 - Prob. 3.17RQCh. 3 - Write an SQL statement to display the breed, type,...Ch. 3 - Prob. 3.19RQCh. 3 - Prob. 3.20RQCh. 3 - Write an SQL statement to display the breed, type,...Ch. 3 - Write an SQL statement to display the name, breed,...Ch. 3 - Write an SQL statement to display the pet ID,...Ch. 3 - Prob. 3.24RQCh. 3 - Prob. 3.25RQCh. 3 - Write an SQL statement to display the name and...Ch. 3 - Prob. 3.27RQCh. 3 - Write an SQL statement to count the number of...Ch. 3 - Write an SQL statement to count the number of...Ch. 3 - Prob. 3.30RQCh. 3 - Prob. 3.31RQCh. 3 - Prob. 3.32RQCh. 3 - Prob. 3.33RQCh. 3 - Answer question 3.33, but do not consider any pet...Ch. 3 - Write an SQL statement to display the last name,...Ch. 3 - Write an SQL statement to display the last name,...Ch. 3 - Write SQL statements to (1) create the BREED...Ch. 3 - Prob. 3.38RQCh. 3 - Prob. 3.39RQCh. 3 - Prob. 3.40RQCh. 3 - Write an SQL statement to display the...Ch. 3 - Write SQL statements to add three new rows to the...Ch. 3 - Write SQL statements to add three new rows to the...Ch. 3 - Write an SQL statement to change the value of Std....Ch. 3 - Explain what will happen if you leave the WHERE...Ch. 3 - Prob. 3.46RQCh. 3 - Prob. 3.47RQCh. 3 - Prob. 3.48RQ
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- Repeat Exercise 4, but this time use the EXISTS operator in your query.arrow_forwardPL/SQL Question I need to build pl/sql block that prompts a user for the number of visitors each day for the past 5 days and then displays the average number of visitors per day. For example; day 1: 19 day 2: 21 day 3: 23 ... The avg number of visitors is: ___ like this.arrow_forwardUse SQL Developer or Oracle Live SQL to write the appropriate SQL commands as follows: ) PROCEDURE: Use the cust_node table to create a procedure called ‘Get_node_id’ that takes the cust_idas an input parameter to show its corresponding node id to the banker. Then execute this procedure withcust_id=5.arrow_forward
- Assignment : PL/SQL Practice Note: PL/SQL can be executed in SQL*Plus or SQL Developer or Oracle Live SQL. Write an anonymous PL/SQL block that will insert a new doctor into the DOCTOR Verify that insert has been done successfully by issuing a select * from doctor.arrow_forwardTHIS MODULE IS ABOUT SUBQUERIES, SO YOU MUST USE SUBQUERIES INSTEAD OF TABLE JOINS (a) From which two fields in which table can you calculate the enrollment of a section?(b) From which table can you get both course and section numbers?(c) Which field in table SECTION uniquely identifies a section, section id or section no?(d) Write a SQL statement to show sections and their enrollment.(e) Write a SQL statement to show sections with enrollment greater than five. Display both course andsection numbersarrow_forwardAssignment : PL/SQL Practice Note: PL/SQL can be executed in SQL*Plus or SQL Developer or Oracle Live SQL. Write an anonymous PL/SQL block that will update the salary of all doctors in the Pediatrics area by 1000 (Note: Current salary + 1000). Verify that the salary has been updated by issuing a select * from doctor where area = ‘Pediatrics’. You may have to run the select statement twice to check the data before and after the update.arrow_forward
- Complete the SQL statement to generate the Result table. The column names in the SELECT clause must match the Result table exactly. Order Part • OrderCode PartNumber R58 492 Quantity 4 • PartNumber PartName Price 662 Z23 492 3 492 Wingding Buzzer 11 0.4 A36 662 1 R61 827 1 SELECT /* Type your code here */ FROM Order, Part WHERE /* Type your code here */ Result OrderCode PartName Order.PartNumber Buzzer 492 R58 Z23 Buzzer 492 A36 Wingding 662arrow_forwardDatabase: https://www.w3schools.com/sql/trysql.asp?filename=trysql_select_allarrow_forwardSQL ( ORACLE SQL DEVELOPER ) : THIS IS FIRST , SECOND AND THIRD TABLE for the Task 1 to solve : create table author_45( auth_name char(50), gender char(1), age number(3), nationality char(50), PRIMARY KEY (auth_name) ); create table book_45( isbn number(10), title char(50), ver_no number(2), publisher char(50), PRIMARY KEY (isbn) ); create table writtenBy_45( isbn number(10), auth_name char(50), yr_published number(4), price number(3), no_copy number(4), PRIMARY KEY (isbn,auth_name), foreign key (isbn) references book_45, foreign key (auth_name) references author_45 ); insert into author_45 values ('Benoit','F',42,'French'); insert into author_ 45 values ('Antonini','M',33,'Italian'); insert into author_ 45 values ('McAven','F',31,'Australian'); insert into author_ 45 values ('Williams','M',90,'British'); insert into book_45 values (101,'atabases',1,'Possum'); insert into book_45 values (202,'SQL Primer',2,'Hall'); insert into book_45 values…arrow_forward
- INFO 2303 Database Programming Assignment # : PL/SQL Procedure & Function Practice Note: PL/SQL can be executed in SQL*Plus or SQL Developer or Oracle Live SQL. Write a script to create a PL/SQL procedure called findSal that displays the doctor’s salary and bonus after passing in the doc_id into the procedure. For example, if you pass in doc_id 504, you will get the following output. execute findSal(504) The salary for Dr.Cotner (504) is: 11500 The bonus is: 7500 PL/SQL procedure successfully completed.arrow_forwardINFO 2303 Database Programming Assignment : PL/SQL Practice Note: PL/SQL can be executed in SQL*Plus or SQL Developer or Oracle Live SQL. Write an anonymous PL/SQL block that will delete all patients for doctors that works in the Family Practice Verify that patients have been deleted accordingly. Then do a select * from patients where doc_id = (select doc_id from doctor where area = ‘Family Practice’. You should get no rows.arrow_forwardWrite SQLSQL statements for following: Student( Enrno, name, courseId, emailId, cellno)Course(courseId, course_nm, duration)i) Add a column city in student tableii) Find out list of students who have enrolled in “computer” course.iii) List name of all courses with their duration.iv) List name of all students start with 'a'.v) List email Id and cell no of all mechanical engineering students.arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Database Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781305627482Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781285196145Author:Steven, Steven Morris, Carlos Coronel, Carlos, Coronel, Carlos; Morris, Carlos Coronel and Steven Morris, Carlos Coronel; Steven Morris, Steven Morris; Carlos CoronelPublisher:Cengage LearningA Guide to SQLComputer ScienceISBN:9781111527273Author:Philip J. PrattPublisher:Course Technology Ptr
- Programming with Microsoft Visual Basic 2017Computer ScienceISBN:9781337102124Author:Diane ZakPublisher:Cengage Learning
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781305627482
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781285196145
Author:Steven, Steven Morris, Carlos Coronel, Carlos, Coronel, Carlos; Morris, Carlos Coronel and Steven Morris, Carlos Coronel; Steven Morris, Steven Morris; Carlos Coronel
Publisher:Cengage Learning
A Guide to SQL
Computer Science
ISBN:9781111527273
Author:Philip J. Pratt
Publisher:Course Technology Ptr
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:9781337102124
Author:Diane Zak
Publisher:Cengage Learning