CiS120-PJ 8-DB Admin
.docx
keyboard_arrow_up
School
West Los Angeles College *
*We aren’t endorsed by this school
Course
120
Subject
Computer Science
Date
May 19, 2024
Type
docx
Pages
4
Uploaded by ElderAlbatrossMaster767
CiS120 Intro to Databases
Project 8 (PJ 8)
Dr. Lin
Version 2/13/23
PJ 8 Report
My Name: Keiana Flowers
You must answer all the following 12 questions based on the BITS database (if applicable). Q1. Please write a proper SQL command for each of the following requests regarding privileges of the Client table.
(A) Give ALL the privilege or rights on Client table to UserA. GRANT ALL ON TO CLIENT TO UserA
(B) Give the select, insert, delete, update on Client table to UserB. GRANT, SELECT, INSERT, DELETE, UPDATE ON CLIENT TO UserB
(C) Give the select privilege on Client table to UserC. SELECT ON TO CLIENT TO UserC
(D) Revoke the delete privilege on Client table from UserD. REVOKE DELETE ON TO CLIENT TO UserD
(E) Revoke the alter privilege on Client table from UserE. REVOKE ALTER ON TO CLIENT TO UserE
Q2. In order to improve the performance of accessing client’s consultant information in the BITS database, DBA plans to add Consultant’s LastName and FirstName fields to the Client table. The altered Client table would become as follows: Client ( ClientNum
, ClientName, Street, City, State, ZipCode, Balance, CreditLimit, ConsltNum
, ConsltLastName, ConsltFirstName )
(A) Is the altered Client table in 2NF? Please explain why. Yes, because the primary key contains only one column this makes it 2NF. (B) Is the altered Client table in 3NF? Please explain why.
(C) Is the altered Client table in 4NF? Please explain why.
(B/C) No these are not 3NF or 4NF because ConsltLastName, and ConltFirstName should be in a separate table with ConsltNum as the primary key, and foreign key in the Client table.
Q3. (A) What is a DBA? Why is this position necessary for a DBMS? DBA is Data Base Administrator. A DBA would formulate database policies and constraints, communicate policies to users and enforce those policies.
(B) What are the DBA’s responsibilities regarding access privileges? The DBA assigns access privileges to users.
Page 1
of 4
CiS120 Intro to Databases
Project 8 (PJ 8)
Dr. Lin
Version 2/13/23
(C) What SQL commands can DBA use in order to control access privileges? Grant and Revoke
Q4. (A) What is database denormalization? It is when the redundant data or columns, that already exists in another table, are added to the table
(B) What is the purpose of database denomalization? Increasing the performance of DBMS by reducing the number of disk access.
(C) Please denormalize a table in BITS database, and explain why you have decided to do this denormalization.
Client ( ClientNum, ClientName, Street, City, State, ZipCode, Balance, CreditLimit, ConsltNum, ConsltLastName, ConsltFirstName).
This optimizes the Client table making it easy to have the consultant information.
Q5. (A) What is a disaster recovery plan? What is its purpose? Disaster Recovery plans are put in place in case there are reasons for data loss, system interruptions, or corruption of the database.
(B) What is a data archive? What is its purpose? It archives data from databases that are no longer needed
but still important and necessary for future referencing.
(C) What is the relationship between a database and its data archive?
It allows businesses to be able to keep this data indefinitely without causing the database to become too massive. It also allows for important information to be stored in a secure location to be retrieved when deemed necessary.
Q6. (A) What is a shared lock? What is its purpose?
A shared lock permits other users to read the same data. (B) What is an exclusive lock? What is its purpose? An exclusive lock prevents other users accessing certain data
(C) Does a DBMS use both shared locks and exclusive locks? Why so? Yes, it protects from a concurrent update problem.
Q7. (A) What is “tuning a database”? The DBA changes database design to improve the performance. (B) What is the purpose of tuning a database? It can improve the performance. (C) Who should perform the tuning of a database? How often should it be done? DBA should be performing the tuning and it should be done on a regular basis. Page 2
of 4
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
- Access to all documents
- Unlimited textbook solutions
- 24/7 expert homework help
Related Questions
PLZ help with the following:
The manager wants to add a new painter as an artist in the database. What would the insert statement look like?
For a painter to be considered in the Artist database, the painter must have painted at least one painting, however, a painting might not be exhibited in a gallery. Based on these business rules, please insert one painting for the painter that you inserted in Q1.
sql file
CREATE TABLE GALLERY (GAL_NUM char(4),GAL_OWNER varchar(35),GAL_AREACODE char(3),GAL_PHONE char(8),GAL_RATE number);INSERT INTO GALLERY VALUES('5','L. R. Gilliam','901','123-4456',0.37);INSERT INTO GALLERY VALUES('6','G. G. Waters','405','353-2243',0.45 );INSERT INTO GALLERY VALUES('1','N. D. Cosner','203','123-9956',0.67);INSERT INTO GALLERY VALUES('2','S. H. Artwork','415','154-3243',0.30);
/* -- */
CREATE TABLE PAINTER (PTR_NUM char(4),PTR_LASTNAME varchar(15) NOT NULL,PTR_FIRSTNAME varchar(15) NOT NULL,PTR_AREACODE char(3),PTR_PHONE char(8));INSERT INTO PAINTER…
arrow_forward
Views in SQL are kind of virtual tables. A view also has rows and columns as they are in a real table in the database. We can create a view by selecting fields from one or more tables present in the database. A View can either have all the rows of a table or specific rows based on certain conditions.
Under what circumstances would you create a View?
arrow_forward
Database Access Code Write the codethe best that you can to execute the following SQLstatement against a database. Your code should read thedata from the DB and print out all of the data. Thedatabase is an Access database, setup with an ODBCname of "AccountingDB'. Do the best you can, partialcredit will be given. Put your code in the main methodgiven below. [Hint: SQL will return all accounts from thedatabase.]SOL = "Select AcctNo, Owner, Balance fromAccounts"public static void main (String args[])
arrow_forward
Below is part of a Student database. The primary keys are highlighted in bold.
Student (studNo, studName, address, mobileNo)
Registration (studNo, courseNo, regDate, semester, session)
Course (courseNo, courseName, creditHour, level)
Project (projNo, projName, courseNo)
Assignment (projectNo, studNo, startDate, dueDate, hoursSpent)
QUESTION
1. Write a PL/SQL FUNCTION that calculates the cost each student has to pay for all courses taken. In the photo is example the cost detail for each course.
2. Write a PL/SQL Procedure to call the function you created in question 1 . Allow the user to enter the student ID (studno).
SECOND PHOTO IS THE EXAMPLE OF EXPECTED OUTPUT
arrow_forward
Part 2: PL/SQL
By using PL/SQL create the following:
1- A procedure Proc_Insert(arg2,arg3..argn):
When the procedure is executed, the value of the passed arguments will be inserted into a
table of your database.Note(you have to use one of the created Sequences to generate a
value to be inserted into a field of your table).
2- A Procedure Update_value(arg1,arg2):
The procedure searches about arg1 value in a specific column of your table and changes the
value of the searched item to be equals arg2.
3- A procedure called del_Record_from_Table(arg1) that deletes a specific row from one of the
tables you created.
4- A Function getAllData(arg):
When Your call your function it should search about an item in your table and returns all
data about it.
5- A row type trigger that's fires to accept the deleted rows from a table on your database and
store them into another table.
-You must create a new table to accept the deleted rows.
- The new table must contain two additional columns, the first…
arrow_forward
Submit Result Key Here..
Subm
SQL Injection Escaping Challenge
To complete this challenge, you must exploit SQL injection flaw in the following form to find the result key. The
developer of this level has attempted to stop SQL Injection attacks by escaping apostrophes so the database
interpreter will know not to pay attention to user submitted apostrophes
Challenge Hint
This is the query you are injecting code into! Be aware that your apostrophes are being escaped with a leading
backslash before being sent to the interpreter
SELECT FROM customers WHERE customerld ="
Please enter the Customer Id of the user that you want
to look up
Get user
There were no results found in your search
arrow_forward
Solve C
I. This Project asks you to submit a SQL text file (e.g. project2.sql) with all your answers to all the questions listed in this assignment. Your answers will be written in SQL format. All SQL statements will be tested in a MySQL database including: CREATE TABLE, ALTER TABLE, INSERT and SELECT. You must use the following table structures for your MySQL DDL and DML commands:
STUDENT(StudentID, LastName, FirstName, Address, City, State, Zip, Phone)
StudentID will be automatically increased integer identifier
Choose VARCHAR or CHAR based on your personal understanding of the fields for the rest part of the relation/table
STUDENT_TEXTBOOK(StudentID, TextbookID, Class, Semester, Year)
Semester would be CHAR
Year would be integer
TEXTBOOK(TextbookID, Description, Price, Location, BookstoreID)
TextbookID will be automatically increased integer identifier
Price is a decimal with 2 decimal places after zero
Description and Location can be VARCHAR or CHAR based on your personal…
arrow_forward
Write in SQL a command that creates the table Customers according to the above description.
Write in SQL a statement that adds a new column named accountID of type Char(8). This column should be defined as a foreign key that relates the table Customers to the table Account .
Write in SQL a command that deletes the customers whose date of birth is after 22-Dec-1990 .
arrow_forward
Access Assignment
Problem: JMS TechWizards is a local company that provides technical services to several small businesses in the area. The company currently keeps its technicians and clients’ records on papers. The manager requests you to create a database to store the technician and clients’ information.
The following table contains the clients’ information.
Client Number
Client Name
Street
City
State
Postal Code
Telephone Number
Billed
Paid
Technician Number
AM53
Ashton-Mills
216 Rivard
Anderson
TX
78077
512-555-4070
$315.50
$255.00
22
AR76
The Artshop
722 Fisher
Liberty Corner
TX
78080
254-555-0200
$535.00
$565.00
23
BE29
Bert's Supply
5752 Maumee
Liberty Corner
TX
78080
254-555-2024
$229.50
$0.00
23
DE76
D & E Grocery
464 Linnell
Anderson
TX
78077
512-555-6050
$485.70…
arrow_forward
PL/SQL Help
I need to create a PL/SQL trigger called aprove_rental that will prevent an INSERT if a clients rating (client_credit_rtg) is less than 1.5 from the rental table. Im using sqlplus to test this trigger.
Tables :
create table client
(client_num char(4),
client_lname varchar2(15) not null,
client_fname varchar2(15),
client_phone char(8),
client_credit_rtg decimal(2,1) check(client_credit_rtg between 0.0 and 5.0),
client_fave_cat char(3),
primary key (client_num),
foreign key (client_fave_cat) references movie_category(category_code)
);
create table rental
(rental_num char(7),
client_num char(4),
vid_id char(6),
date_out date not null,
date_due date not null,
date_returned date,
primary key (rental_num),
foreign key (client_num) references client,
foreign key (vid_id) references video
);
PLEASE WRITE THIS FROM SCRATCH AND NOT JUST COPY AND PASTE FROM ANOTHER ANSWER, BECAUSE THEY DONT WORK FOR ME
arrow_forward
Please written by computer source
1. For this project, you need to create the company database and populate it with the data given in the Oracle SQL PLUS environment (if you have not done so) 2. Your SQL commands should be placed in file(s) and run from the file(s). 3. Implement Triggers on all the tables to change character data to uppercase in the character data type columns. 4. Implement a Function that returns Dname from Department for any give employee. The parameter to the function would be the SSN. 5. Implement a Function that returns manager’s full name for any given department. The parameter to the function would be the department name. 6. Implement another Function that returns manager’s full name for any given department. The parameter to the function would be the department number. 7. Implement a Procedure that increases an employee salary by x%. Employee is identified by SSN and the percentage of increase is given as an input. 8. Implement a Package that contains the…
arrow_forward
Please help with the following: Using oracle sql live or sql developer
what sql statements could be use to find the following: A simple database composed of the following tables: PATIENT, DOCTOR, DRUG, and PRESCRIPTION, is now loaded with this assignment and you are ready to start. Please explore the database and then write the appropriate SQL command.
List doctor’s details where speciality is either Dermatology or Neurology. (Use INoperator). List the results by the first name in ascending order and the last name indescending order
sql doc below
Beginfor c in (select table_name from user_tables) loopexecute immediate ('drop table '||c.table_name||' cascade constraints');end loop;End;//* */
ALTER SESSION SET NLS_DATE_FORMAT = 'MM/DD/YYYY';CREATE TABLE DOCTOR (DOC_ID varchar2(5) PRIMARY KEY,DOC_LNAME varchar2(15),DOC_FNAME varchar2(15),DOC_INITIAL varchar2(1),DOC_SPECIALTY varchar2(15));INSERT INTO DOCTOR VALUES('29827','Sanchez','Julio','J','Dermatology');INSERT INTO DOCTOR…
arrow_forward
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'show database
CREATE DATABASE [Da]USE PETSTORE' at line 3mysql> use petstoreERROR 1049 (42000): Unknown database 'petstore'mysql> create database [da] -> use petstore -> -> CREATE TABLE USERS (user_id VARCHAR(30), password -> VARCHAR(30), first_name VARCHAR(50), last_name VARCHAR(50));ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '[da]
==========
whats the wrong with this work ,
what code is correct when i ma trying to make a new table and a new databse in this mysql commend line ?
arrow_forward
THIS 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 numbers
arrow_forward
simple database composed
following
les: PATI
DRUG, and
PRESCRIPTION, is now loaded with this assignment and you are ready to start. Please explore
the database and then write the appropriate SQL command to answer the following questions.
1. List all the rows in which the prescription dates occur on or after November 14.
2. How many doctors provide prescriptions with 30 tablets in total?
3. List doctor's details where specialty is either Dermatology or Neurology. (Use IN
operator). List the results by the first name in ascending order and the last name in
descending order
4. Find all patients rows whose first names include 'George' (Assume case sensitivity).
5. List number of patients that do not have a phone number.
6. How many drugs with price < 40$?
7.
How many prescriptions are generated for each patient, limit the listing to patients who
have more than 2 prescriptions?
8. List number of female patients born in 1970
9. List the drug codes and prices (rounded to one decimal place).…
arrow_forward
Task 3:
The Marketing team wants to collect emails of the users on InstantStay. However, the team needs a SQL statement to execute inside their programming environment. You need to create a statement that they can easily run the EXECUTE command to return a single column table containing the USER_EMAIL addresses.
Task: Create a prepared statement for use with the EXECUTE command.
arrow_forward
Instructions
Write SQL queries to solve the following problems. We will be using the “university” database. All queries should involve only the instructor table. After you are done, save your work as .sql file and turn in the .sql file into Moodle for grading.
Write a SQL statement to display all columns using the SQL asterisk (*) wild-card character.
Write a SQL statement to display ID and name of the instructors (ID appears first).
Write a SQL statement to display department names.
Write a SQL statement to display unique department names. (expect 7 rows returned)
Write a SQL statement to display all info about instructors having a salary greater than 75000. (expect 6 rows returned)
Write a SQL statement to display department name, instructor name, and salary for instructors that have a salary less than 70000. Sort the results in ascending order by department name. (expect 4 rows returned)
Write a SQL statement to display name, department name, and salary for instructors that have a…
arrow_forward
MS SQL server
Create a Stored Procedures with the name of “usp_CalculateTotals”. usp_CalculateTotals should take three parameters: a client’s social security number (input parameter), mode (input parameter), and the total (output parameter). If the mode is 1, it should calculate the total balance of all the accounts of the client. If the mode is 2, it should calculate the total withdrawal amounts the client has done, and if the mode is 3, it should calculate the total deposit amounts the client has done. Implement the stored procedure below:
arrow_forward
Using php and sql:
Create a PDO object to connect to your database for running select queries.Write a database query to output all the messages in the messages table.
arrow_forward
Q1) Create a database called (heavy duty cars) that has these tables or write the
SQL command to create the database and the tables
Truck(truck ID, truck_name, price, color,manufacturer, No_cylinder,
owner_ID)
Owner(owner ID, name, No_trucks, phone_No, address)
answer the following SQL queries:
1- Find the manufacturer of trucks that has 4 cylinders and its price is less than
the average price of all trucks that manufactured by BMW.
2- count all trucks owned by Mr.Ali and their price less than 55000.
3- find the average price of black trucks that has 4 cylinder grouped by the
manufacturer.
4- find all the owners who have 7 trucks manufactured by Audi.
arrow_forward
Task 3:
The InstantRide Finance team wants to collect the price and discount information with the driver names for each travel in the system. You need to return the TRAVEL_ID, DRIVER_FIRST_NAME, DRIVER_LAST_NAME, TRAVEL_PRICE, and TRAVEL_DISCOUNT information from the TRAVELS and DRIVERS tables combined over DRIVER_ID field with the ON keyword.
Task: Calculate each user's price and discount information. (SQL Database Test)
arrow_forward
Create an SQL package specification and body called JOB_PKG, containing the following procedures:
Create a procedure called ADD_JOB to insert a new job into the JOBS table. The procedure has job id, job title, minimum salary and maximum salary as parameters. Ensure that the value of maximum salary is greater than minimum salary, raise an exception if this rule is violated (create a private procedure for salary validation).
arrow_forward
1. Implement the designed database using MS SQL.1.1. Implement all tables1.2. Save all SQL statements1.3 Enter data to show your database is appropriately designed. You may enter the data directly into MS SQL.- At least five records in each table
arrow_forward
) Create a database called cars that has these tables or write the SQL
command to create the database and the tables
Car(car_ID, car_name, price, color, manufacturer, No_cylinder, owner_ID)
Owner(owner_ID, name, No_cars, phone_No, address)
answer the following SQL queries:
1- Find the cars names that has 4 cylinders and its price is greater than the
average price of all cars that manufactured by Audi.
2- Find all red cars owned by Mr.Ali.
3- find the summation of black cars prices that has 4 cylinder.
4- delete all the owners who live in New York.
arrow_forward
The database contains a Horse table, with columns:
ID integer, primary key
Registered Name
variable-length string.
The database contains a Student table, with columns:
• ID integer, primary key
First Name - variable-length string
LastName variable-length string
Write a SQL Query to create a Schedule table, with columns:
HorseID - integer with range 0 to 65535, not NULL
• Student ID integer with range 0 to 65535
Lesson DateTime - date/time, not NULL
(HorseID, Lesson DateTime) is the primary key
Also, create the following foreign key constraints on Schedule columns:
HorseID references Horse. When an ID is deleted from Horse
matching Lesson Schedule rows are deleted.
Student ID references Student. When an ID is deleted
from Student, matching Student ID 's are set to NULL).
arrow_forward
Write a PL/SQL block that will allow the user to enter FNo and that will display Customer Name from Booking table. Include predefined exception with suitable messages1- SQL returns more than one records2- Records are not available
arrow_forward
Sales Database:
Customers(custId, lastName, firstName, address, phone, creditLimit)
Orders(ordNumber, itemNumber, qtyOrdered.)
Items(itemNumber, itemName, price)
For the Sales Database referenced above, write the SQL command to create the LineItem table, assuming the Orders table and items table already exist.
arrow_forward
in sql
The keyword that you would use to grant an object privilege to all database users is:
Select one:
a. PUBLIC
b. ADMIN
c. ALL
d. GRANT
arrow_forward
I. This Project asks you to submit a SQL text file (e.g. project2.sql) with all your answers to all the questions listed in this assignment. Your answers will be written in SQL format. All SQL statements will be tested in a MySQL database including: CREATE TABLE, ALTER TABLE, INSERT and SELECT. You must use the following table structures for your MySQL DDL and DML commands:
STUDENT(StudentID, LastName, FirstName, Address, City, State, Zip, Phone)
StudentID will be automatically increased integer identifier
Choose VARCHAR or CHAR based on your personal understanding of the fields for the rest part of the relation/table
STUDENT_TEXTBOOK(StudentID, TextbookID, Class, Semester, Year)
Semester would be CHAR
Year would be integer
TEXTBOOK(TextbookID, Description, Price, Location, BookstoreID)
TextbookID will be automatically increased integer identifier
Price is a decimal with 2 decimal places after zero
Description and Location can be VARCHAR or CHAR based on your personal…
arrow_forward
SEE MORE QUESTIONS
Recommended textbooks for you
![Text book image](https://www.bartleby.com/isbn_cover_images/9781305251038/9781305251038_smallCoverImage.gif)
![Text book image](https://www.bartleby.com/isbn_cover_images/9781111527273/9781111527273_smallCoverImage.gif)
A Guide to SQL
Computer Science
ISBN:9781111527273
Author:Philip J. Pratt
Publisher:Course Technology Ptr
![Text book image](https://www.bartleby.com/isbn_cover_images/9781337102124/9781337102124_smallCoverImage.gif)
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:9781337102124
Author:Diane Zak
Publisher:Cengage Learning
Related Questions
- PLZ help with the following: The manager wants to add a new painter as an artist in the database. What would the insert statement look like? For a painter to be considered in the Artist database, the painter must have painted at least one painting, however, a painting might not be exhibited in a gallery. Based on these business rules, please insert one painting for the painter that you inserted in Q1. sql file CREATE TABLE GALLERY (GAL_NUM char(4),GAL_OWNER varchar(35),GAL_AREACODE char(3),GAL_PHONE char(8),GAL_RATE number);INSERT INTO GALLERY VALUES('5','L. R. Gilliam','901','123-4456',0.37);INSERT INTO GALLERY VALUES('6','G. G. Waters','405','353-2243',0.45 );INSERT INTO GALLERY VALUES('1','N. D. Cosner','203','123-9956',0.67);INSERT INTO GALLERY VALUES('2','S. H. Artwork','415','154-3243',0.30); /* -- */ CREATE TABLE PAINTER (PTR_NUM char(4),PTR_LASTNAME varchar(15) NOT NULL,PTR_FIRSTNAME varchar(15) NOT NULL,PTR_AREACODE char(3),PTR_PHONE char(8));INSERT INTO PAINTER…arrow_forwardViews in SQL are kind of virtual tables. A view also has rows and columns as they are in a real table in the database. We can create a view by selecting fields from one or more tables present in the database. A View can either have all the rows of a table or specific rows based on certain conditions. Under what circumstances would you create a View?arrow_forwardDatabase Access Code Write the codethe best that you can to execute the following SQLstatement against a database. Your code should read thedata from the DB and print out all of the data. Thedatabase is an Access database, setup with an ODBCname of "AccountingDB'. Do the best you can, partialcredit will be given. Put your code in the main methodgiven below. [Hint: SQL will return all accounts from thedatabase.]SOL = "Select AcctNo, Owner, Balance fromAccounts"public static void main (String args[])arrow_forward
- Below is part of a Student database. The primary keys are highlighted in bold. Student (studNo, studName, address, mobileNo) Registration (studNo, courseNo, regDate, semester, session) Course (courseNo, courseName, creditHour, level) Project (projNo, projName, courseNo) Assignment (projectNo, studNo, startDate, dueDate, hoursSpent) QUESTION 1. Write a PL/SQL FUNCTION that calculates the cost each student has to pay for all courses taken. In the photo is example the cost detail for each course. 2. Write a PL/SQL Procedure to call the function you created in question 1 . Allow the user to enter the student ID (studno). SECOND PHOTO IS THE EXAMPLE OF EXPECTED OUTPUTarrow_forwardPart 2: PL/SQL By using PL/SQL create the following: 1- A procedure Proc_Insert(arg2,arg3..argn): When the procedure is executed, the value of the passed arguments will be inserted into a table of your database.Note(you have to use one of the created Sequences to generate a value to be inserted into a field of your table). 2- A Procedure Update_value(arg1,arg2): The procedure searches about arg1 value in a specific column of your table and changes the value of the searched item to be equals arg2. 3- A procedure called del_Record_from_Table(arg1) that deletes a specific row from one of the tables you created. 4- A Function getAllData(arg): When Your call your function it should search about an item in your table and returns all data about it. 5- A row type trigger that's fires to accept the deleted rows from a table on your database and store them into another table. -You must create a new table to accept the deleted rows. - The new table must contain two additional columns, the first…arrow_forwardSubmit Result Key Here.. Subm SQL Injection Escaping Challenge To complete this challenge, you must exploit SQL injection flaw in the following form to find the result key. The developer of this level has attempted to stop SQL Injection attacks by escaping apostrophes so the database interpreter will know not to pay attention to user submitted apostrophes Challenge Hint This is the query you are injecting code into! Be aware that your apostrophes are being escaped with a leading backslash before being sent to the interpreter SELECT FROM customers WHERE customerld =" Please enter the Customer Id of the user that you want to look up Get user There were no results found in your searcharrow_forward
- Solve C I. This Project asks you to submit a SQL text file (e.g. project2.sql) with all your answers to all the questions listed in this assignment. Your answers will be written in SQL format. All SQL statements will be tested in a MySQL database including: CREATE TABLE, ALTER TABLE, INSERT and SELECT. You must use the following table structures for your MySQL DDL and DML commands: STUDENT(StudentID, LastName, FirstName, Address, City, State, Zip, Phone) StudentID will be automatically increased integer identifier Choose VARCHAR or CHAR based on your personal understanding of the fields for the rest part of the relation/table STUDENT_TEXTBOOK(StudentID, TextbookID, Class, Semester, Year) Semester would be CHAR Year would be integer TEXTBOOK(TextbookID, Description, Price, Location, BookstoreID) TextbookID will be automatically increased integer identifier Price is a decimal with 2 decimal places after zero Description and Location can be VARCHAR or CHAR based on your personal…arrow_forwardWrite in SQL a command that creates the table Customers according to the above description. Write in SQL a statement that adds a new column named accountID of type Char(8). This column should be defined as a foreign key that relates the table Customers to the table Account . Write in SQL a command that deletes the customers whose date of birth is after 22-Dec-1990 .arrow_forwardAccess Assignment Problem: JMS TechWizards is a local company that provides technical services to several small businesses in the area. The company currently keeps its technicians and clients’ records on papers. The manager requests you to create a database to store the technician and clients’ information. The following table contains the clients’ information. Client Number Client Name Street City State Postal Code Telephone Number Billed Paid Technician Number AM53 Ashton-Mills 216 Rivard Anderson TX 78077 512-555-4070 $315.50 $255.00 22 AR76 The Artshop 722 Fisher Liberty Corner TX 78080 254-555-0200 $535.00 $565.00 23 BE29 Bert's Supply 5752 Maumee Liberty Corner TX 78080 254-555-2024 $229.50 $0.00 23 DE76 D & E Grocery 464 Linnell Anderson TX 78077 512-555-6050 $485.70…arrow_forward
- PL/SQL Help I need to create a PL/SQL trigger called aprove_rental that will prevent an INSERT if a clients rating (client_credit_rtg) is less than 1.5 from the rental table. Im using sqlplus to test this trigger. Tables : create table client (client_num char(4), client_lname varchar2(15) not null, client_fname varchar2(15), client_phone char(8), client_credit_rtg decimal(2,1) check(client_credit_rtg between 0.0 and 5.0), client_fave_cat char(3), primary key (client_num), foreign key (client_fave_cat) references movie_category(category_code) ); create table rental (rental_num char(7), client_num char(4), vid_id char(6), date_out date not null, date_due date not null, date_returned date, primary key (rental_num), foreign key (client_num) references client, foreign key (vid_id) references video ); PLEASE WRITE THIS FROM SCRATCH AND NOT JUST COPY AND PASTE FROM ANOTHER ANSWER, BECAUSE THEY DONT WORK FOR MEarrow_forwardPlease written by computer source 1. For this project, you need to create the company database and populate it with the data given in the Oracle SQL PLUS environment (if you have not done so) 2. Your SQL commands should be placed in file(s) and run from the file(s). 3. Implement Triggers on all the tables to change character data to uppercase in the character data type columns. 4. Implement a Function that returns Dname from Department for any give employee. The parameter to the function would be the SSN. 5. Implement a Function that returns manager’s full name for any given department. The parameter to the function would be the department name. 6. Implement another Function that returns manager’s full name for any given department. The parameter to the function would be the department number. 7. Implement a Procedure that increases an employee salary by x%. Employee is identified by SSN and the percentage of increase is given as an input. 8. Implement a Package that contains the…arrow_forwardPlease help with the following: Using oracle sql live or sql developer what sql statements could be use to find the following: A simple database composed of the following tables: PATIENT, DOCTOR, DRUG, and PRESCRIPTION, is now loaded with this assignment and you are ready to start. Please explore the database and then write the appropriate SQL command. List doctor’s details where speciality is either Dermatology or Neurology. (Use INoperator). List the results by the first name in ascending order and the last name indescending order sql doc below Beginfor c in (select table_name from user_tables) loopexecute immediate ('drop table '||c.table_name||' cascade constraints');end loop;End;//* */ ALTER SESSION SET NLS_DATE_FORMAT = 'MM/DD/YYYY';CREATE TABLE DOCTOR (DOC_ID varchar2(5) PRIMARY KEY,DOC_LNAME varchar2(15),DOC_FNAME varchar2(15),DOC_INITIAL varchar2(1),DOC_SPECIALTY varchar2(15));INSERT INTO DOCTOR VALUES('29827','Sanchez','Julio','J','Dermatology');INSERT INTO DOCTOR…arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- A Guide to SQLComputer ScienceISBN:9781111527273Author:Philip J. PrattPublisher:Course Technology PtrProgramming with Microsoft Visual Basic 2017Computer ScienceISBN:9781337102124Author:Diane ZakPublisher:Cengage Learning
![Text book image](https://www.bartleby.com/isbn_cover_images/9781305251038/9781305251038_smallCoverImage.gif)
![Text book image](https://www.bartleby.com/isbn_cover_images/9781111527273/9781111527273_smallCoverImage.gif)
A Guide to SQL
Computer Science
ISBN:9781111527273
Author:Philip J. Pratt
Publisher:Course Technology Ptr
![Text book image](https://www.bartleby.com/isbn_cover_images/9781337102124/9781337102124_smallCoverImage.gif)
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:9781337102124
Author:Diane Zak
Publisher:Cengage Learning