My anserwer has erro in line 1, how to fix? Add a column named Base_salary with a datatype of NUMBER(7,2) to the STORE_REPS table. Ensure that the amount entered is above zero Alter table store_repsADD base_salary NUMBER(7,2) ADD (Constraint base_salary_ck CHECK(base_salary>0));
Q: Display the data of all employees who do not have managers. (means whose managers are null) Display…
A: Given: CREATE TABLE DEPT ( DEPTNO NUMBER(10) NOT NULL, DNAME VARCHAR2(50) NOT NULL, LOC…
Q: Write a script to create a PL/SQL procedure that modifies the next date of appointment of certain…
A: Given table created and values are inserted into table using given script. The PL/SQL procedure for…
Q: Question 6 Consider the following table schema: CREATE TABLE members( member_id INT, first_name…
A: To Do: We need to identify the column for indexing.
Q: Write a query to show all employee name, present salary and 30% incremented salary of those…
A: The given problem is related to database query language where the CREATE table statement is given…
Q: Create an UPDATE trigger called tr_check_qty on the OrderDetails table to prevent the updating of…
A: Creating an UPDATE trigger called tr_check_qty on the OrderDetails table. Table to prevent the…
Q: Write a query to delete payment details from payments table where discount coupon 'D1' was applied…
A: As per question we have to develop SQL query to delete payment details from payments table where…
Q: Write an insert query to add the following document to the Bikez.com database:
A: There are 3 steps to adding the query to the database. -->To insert a query into the database, we…
Q: CREATE TABLE EMPLOYEE( ENUM DECIMAL(12) NOT NULL,/* Employee number */ FNAME VARCHAR(50) NOT NULL,/*…
A: the answer is:
Q: Write a query against OrderDetails Table, that returns the running quantity for each order using…
A: Below is the required query:
Q: You’re creating a new table consisting of three columns: Col1, Col2, and Col3. Col1 should be the…
A: It requires only two constraints, one PRIMARY KEY constraint for Col1 and one NOT NULL constraint…
Q: AirplaneID int NOT NULL, Model TEXT NOT NULL, Capacity NUMBER(3)NOT NULL, Maintenance_Date DATE,…
A: Given Query: Create table Airplane(AirplaneID int NOT NULL,Model TEXT NOT NULL,Capacity NUMBER(3)NOT…
Q: CREATE TABLE DOCTOR (DOC_ID NUMBER(3), DOC_NAME VARCHAR2(9), DATEHIRED DATE, SALPERMON NUMBER(12),…
A: Answer: 1. SELECT COUNT(*) FROM DOCTOR WHERE DOC_ID IN (SELECT DOC_ID FROM PATIENT); 2. SELECT…
Q: Write a Splunk query that would return the average of given field in a request included in an index…
A: index=abc sourcetype=xy.. |timechart span=15s count as events by host | addtotals
Q: The hospital has decided for each year the doctor has worked, he/s be given an extra RM1000. Write a…
A: The given is a table created in Oracle database named Doctor. The DDL (create table) and DML (insert…
Q: How many NOT NULL constraints can be created at the table level by using the CREATE TABLE command? (…
A: Utilizing the CREATE TABLE command, "0" NOT NULL constraints can be created at the table level.…
Q: Which one of the following join is used to combine the table itself? O a Cross Join Ob. Inner Join…
A: Question Which one of the following join is used to combine the table itself? a. Cross join b.…
Q: What is the difference between disabling a constraint and dropping a constraint? ( refer to the…
A: Difference between disabling a constraint and dropping a constraint: The differences are given as a…
Q: Based on table below, using oracle: used subqueries,display the building location that has the most…
A: A query is a form of language being used in Oracle database to extract data from tables, data…
Q: Write a query to display the guest names who are from Ooty. For instance, the guest name "geeta…
A: Given:
Q: Write a query to delete payment details from payments table where discount coupon 'D1' was applied.…
A: Required: We have to write a SQL query to delete payment details from payments table where discount…
Q: CREATE TABLE DOCTOR (DOC_ID NUMBER(3), DOC_NAME VARCHAR2(9), DATEHIRED DATE, SALPERMON NUMBER(12),…
A: Given: CREATE TABLE DOCTOR(DOC_ID NUMBER(3),DOC_NAME VARCHAR2(9),DATEHIRED DATE,SALPERMON…
Q: CREATE TABLE EMPLOYEE( ENUM DECIMAL(12) NOT NULL,/* Employee number */ FNAME VARCHAR(50) NOT NULL,/*…
A: the code is :
Q: Write a script to create a PL/SQL procedure called findSal that displays the doctor's salary and…
A: Procedure In DBMS: Using a PL/SQL block, the procedure can be created to carry out specific database…
Q: #3 At a given organization, the COVERAGE_MEMBER_LIST table has 500 rows of data. Exactly 200 of…
A: If count Function can be used as count(*) will return the number of rows in a specified table or…
Q: (50) NOT NULL,/* First name */ LNAME VARCHAR(50) NOT NULL,/* Last name */ DOB DATE NULL,/* Date of…
A: the answer is :
Q: Write a query against OrderDetails Table, that returns the running quantity for each order using…
A: answer given below...
Q: Write a query to display maximum bus tickets fare and give an alias name as MAXIMUM_AMOUNT BUSES…
A: Required: We have to write an SQL query that displays the maximum bus tickets fare and print it…
Q: Based on table below, using oracle: used subqueries,display the name of supplier's that supplied…
A: To Fetch more expensive computer than that being supplied by IBM we need to use the subqueries and…
Q: Write a query to delete payment details from payments table where discount coupon 'D1' was applied.…
A: Required: We have to write a SQL query to delete payment details from payments table where discount…
Q: Based on table below, using oracle: used subqueries, display the name of supplier(s) that supplied…
A: MAX will fetch the maximum value in column
Q: write Command to insert data into this tables create table patients ( patient_id VARCHAR(255),…
A: Hi Student Warm Welcome from my side. Hope you are doing great. Here's your required answer.
Q: Write a query against QrderDetails Table, that returns the running quantity for each order using…
A: Table-1 CREATE TABLE Categories ( CategoryID int NOT NULL, CategoryName varchar(255), PRIMARY…
Q: Create an UPDATE trigger called tr_check_qty on the OrderDetails table to prevent the updating of…
A: The orderdetails table have the details The product table have the details The trigger is created…
Q: PLZ help with the following: Use oracle live sql to change the following commands so that they work…
A: To insert records into autoincrement table. Only specify values to column which is not…
Q: CREATE TABLE DOCTOR (DOC_ID NUMBER(3), DOC_NAME VARCHAR2(9), DATEHIRED DATE, SALPERMON NUMBER(12),…
A: Scripts DROP TABLE PATIENT; DROP TABLE BILLING; DROP TABLE DOCTOR; CREATE TABLE DOCTOR( DOC_ID…
Q: Based on table below, using oracle: used subqueries,display the supplier that supplied the most…
A: Given: Based on table below, using oracle: used subqueries,display the supplier that supplied the…
Q: Which of the following options will cause the execution of your queries to be slowed? Indexes Query…
A: To choose which of the following SQL operation will cause the slowness.
Q: Write a query to delete payment details from payments table where discount coupon 'D1' was applied.…
A: As with each question we should develop an SQL query to remove the payment details from the payment…
Q: Based on table below, using oracle. used subqueries,display the name of supplier's that supplied…
A: Check for the supplier id's who supplied whose value is more than that of IBM computers Then, you…
Q: Q.1.3Alter the EMPLOYEES table to add a column as specified below: EMPLOYEES AGE SMALLINT Q.1.4…
A: “Since you have asked multiple questions, we will solve the first question for you. If you…
Q: Write a query to create the “Student” table (SID, Sname, SAge, SDept, SCity), where the Student ID…
A: Lets see the solution.
Q: d. Create a NewMember table with only using the membership name (Fname and Lname) and membership…
A: Create tables and insert data into it. Subqueries allow you to write queries that pick data rows…
Q: Tollowin TABLE CUSTOMER Column Null? Туре CUS_ID NOT NULL NUMBER NAME VARCHAR2(58) CUS_PHONE…
A: Answer ;-- option c Select cus_id,customer.name,region.name from customer LEFT JOIN region on…
Q: How does the CHECK constraint shown below work? Which tables does it work on? CREATE TABLE DEPT_MGR(…
A: Whenever the tables are created, the constraints are given to the data in that table. This makes…
Q: ses( address_id varchar2(10) not null constraint addresses_pk primary key, city varchar2(20) not…
A: List the name of doctors with the number of written prescriptions. List the customers and the number…
Q: Write a function that takes patient date of birth. If the patient born after 30m June 1990 then…
A: Here, the function is write as PL/SQL procedure function. function read the id and date of birth,…
Q: ЕMP EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO Dept DEPTNO DNAME LOC - MGR field is foreign key…
A: Table creation: create table Dept (DEPTNO varchar(10) primary key, DNAME varchar(20), LOC…
Q: how do i write a join query between the derived table and the orders table to return the Orders…
A: Below i have written query:
SQL
SQL stands for Structured Query Language, is a form of communication that uses queries structured in a specific format to store, manage & retrieve data from a relational database.
Queries
A query is a type of computer programming language that is used to retrieve data from a database. Databases are useful in a variety of ways. They enable the retrieval of records or parts of records, as well as the performance of various calculations prior to displaying the results. A search query is one type of query that many people perform several times per day. A search query is executed every time you use a search engine to find something. When you press the Enter key, the keywords are sent to the search engine, where they are processed by an algorithm that retrieves related results from the search index. Your query's results are displayed on a search engine results page, or SER.
My anserwer has erro in line 1, how to fix?
Add a column named Base_salary with a datatype of NUMBER(7,2) to the STORE_REPS
table. Ensure that the amount entered is above zero
Alter table store_repsADD base_salary NUMBER(7,2)
ADD (Constraint base_salary_ck CHECK(base_salary>0));
*
ERROR at line 1:
ORA-01735: invalid ALTER TABLE option
Trending now
This is a popular solution!
Step by step
Solved in 2 steps
- CREATE TABLE DOCTOR(DOC_ID NUMBER(3),DOC_NAME VARCHAR2(9),DATEHIRED DATE,SALPERMON NUMBER(12),AREA VARCHAR2(20),SUPERVISOR_ID NUMBER(3),CHGPERAPPT NUMBER(3),ANNUAL_BONUS NUMBER(5),CONSTRAINT DOCTOR_DOC_ID_PK PRIMARY KEY (DOC_ID)); INSERT INTO DOCTOR VALUES(432, 'Harrison' , TO_DATE('05-DEC-94'), 12000,'Pediatrics', 100, 75, 4500); INSERT INTO DOCTOR VALUES(509, 'Vester' , TO_DATE('09-JAN-00'), 8100,'Pediatrics', 432, 40, null); INSERT INTO DOCTOR VALUES(389, 'Lewis' , TO_DATE('21-JAN-96'), 10000,'Pediatrics', 432, 40, 2250); INSERT INTO DOCTOR VALUES(504, 'Cotner' , TO_DATE('16-JUN-98'), 11500,'Neurology', 289, 85, 7500); INSERT INTO DOCTOR VALUES(235, 'Smith' , TO_DATE('22-JUN-98'), 4550,'Family Practice', 100, 25, 2250); INSERT INTO DOCTOR VALUES(356, 'James' , TO_DATE('01-AUG-98'), 7950,'Neurology', 289, 80, 6500); INSERT INTO DOCTOR VALUES(558, 'James' , TO_DATE('02-MAY-95'), 9800,'Orthopedics', 876, 85, 7700); INSERT INTO DOCTOR VALUES(876, 'Robertson' , TO_DATE('02-MAR-95'),…CREATE TABLE DOCTOR(DOC_ID NUMBER(3),DOC_NAME VARCHAR2(9),DATEHIRED DATE,SALPERMON NUMBER(12),AREA VARCHAR2(20),SUPERVISOR_ID NUMBER(3),CHGPERAPPT NUMBER(3),ANNUAL_BONUS NUMBER(5),CONSTRAINT DOCTOR_DOC_ID_PK PRIMARY KEY (DOC_ID)); INSERT INTO DOCTOR VALUES(432, 'Harrison' , TO_DATE('05-DEC-94'), 12000,'Pediatrics', 100, 75, 4500); INSERT INTO DOCTOR VALUES(509, 'Vester' , TO_DATE('09-JAN-00'), 8100,'Pediatrics', 432, 40, null); INSERT INTO DOCTOR VALUES(389, 'Lewis' , TO_DATE('21-JAN-96'), 10000,'Pediatrics', 432, 40, 2250); INSERT INTO DOCTOR VALUES(504, 'Cotner' , TO_DATE('16-JUN-98'), 11500,'Neurology', 289, 85, 7500); INSERT INTO DOCTOR VALUES(235, 'Smith' , TO_DATE('22-JUN-98'), 4550,'Family Practice', 100, 25, 2250); INSERT INTO DOCTOR VALUES(356, 'James' , TO_DATE('01-AUG-98'), 7950,'Neurology', 289, 80, 6500); INSERT INTO DOCTOR VALUES(558, 'James' , TO_DATE('02-MAY-95'), 9800,'Orthopedics', 876, 85, 7700); INSERT INTO DOCTOR VALUES(876, 'Robertson' , TO_DATE('02-MAR-95'),…CREATE TABLE DOCTOR(DOC_ID NUMBER(3),DOC_NAME VARCHAR2(9),DATEHIRED DATE,SALPERMON NUMBER(12),AREA VARCHAR2(20),SUPERVISOR_ID NUMBER(3),CHGPERAPPT NUMBER(3),ANNUAL_BONUS NUMBER(5),CONSTRAINT DOCTOR_DOC_ID_PK PRIMARY KEY (DOC_ID)); INSERT INTO DOCTOR VALUES(432, 'Harrison' , TO_DATE('05-DEC-94'), 12000,'Pediatrics', 100, 75, 4500); INSERT INTO DOCTOR VALUES(509, 'Vester' , TO_DATE('09-JAN-00'), 8100,'Pediatrics', 432, 40, null); INSERT INTO DOCTOR VALUES(389, 'Lewis' , TO_DATE('21-JAN-96'), 10000, 'Pediatrics', 432, 40, 2250); INSERT INTO DOCTOR VALUES(504, 'Cotner' , TO_DATE('16-JUN-98'), 11500,'Neurology', 289, 85, 7500); INSERT INTO DOCTOR VALUES(235, 'Smith' , TO_DATE('22-JUN-98'), 4550, 'Family Practice', 100, 25, 2250); INSERT INTO DOCTOR VALUES(356, 'James' , TO_DATE('01-AUG-98'), 7950,'Neurology', 289, 80, 6500); INSERT INTO DOCTOR VALUES(558, 'James' , TO_DATE('02-MAY-95'), 9800, 'Orthopedics', 876, 85, 7700); INSERT INTO DOCTOR VALUES(876, 'Robertson' , TO_DATE('02-MAR-95'),…
- CREATE TABLE DOCTOR(DOC_ID NUMBER(3),DOC_NAME VARCHAR2(9),DATEHIRED DATE,SALPERMON NUMBER(12),AREA VARCHAR2(20),SUPERVISOR_ID NUMBER(3),CHGPERAPPT NUMBER(3),ANNUAL_BONUS NUMBER(5),CONSTRAINT DOCTOR_DOC_ID_PK PRIMARY KEY (DOC_ID)); INSERT INTO DOCTOR VALUES(432, 'Harrison' , TO_DATE('05-DEC-94'), 12000,'Pediatrics', 100, 75, 4500); INSERT INTO DOCTOR VALUES(509, 'Vester' , TO_DATE('09-JAN-00'), 8100,'Pediatrics', 432, 40, null); INSERT INTO DOCTOR VALUES(389, 'Lewis' , TO_DATE('21-JAN-96'), 10000,'Pediatrics', 432, 40, 2250); INSERT INTO DOCTOR VALUES(504, 'Cotner' , TO_DATE('16-JUN-98'), 11500,'Neurology', 289, 85, 7500); INSERT INTO DOCTOR VALUES(235, 'Smith' , TO_DATE('22-JUN-98'), 4550,'Family Practice', 100, 25, 2250); INSERT INTO DOCTOR VALUES(356, 'James' , TO_DATE('01-AUG-98'), 7950,'Neurology', 289, 80, 6500); INSERT INTO DOCTOR VALUES(558, 'James' , TO_DATE('02-MAY-95'), 9800,'Orthopedics', 876, 85, 7700); INSERT INTO DOCTOR VALUES(876, 'Robertson' , TO_DATE('02-MAR-95'),…Add two columns to the EMPLOYEES table. One column, named EmpDate, contains thedate of employment for each employee, and its default value should be the system date. Thesecond column, named EndDate, contains employees’ date of termination. When I put this formal it says, line 2 has invalid identifier! Can you help me what I need to fix from line 2? alter table EMPLOYEES2add column EmpDate date = getdate(),add column EndDate;IN MYSQL 1. Write a query to create the “Student” table (SID, Sname, SAge, SDept, SCity), where the Student ID and Student Name cannot be NULL.2. Write a query to alter the above “Student” table, where a new column of Date of Birth (DOB) must be added, and it should not have any NULL values.3. Write a query to alter the “Student” table, where a CHECK constraint must be added to the “SCity” column and it must be “Vellore”.
- IN MYSQL 1. Write a query to alter the “Student” table, by setting the default value of Age > 20.2. Drop both Check and Default constraint (Qn 3 & 4) of the “Student” table.3. Write a query to create a table “Course”, with columns Course ID, Course Title and Courseoffering Dept (CoD). The Course ID, and Course Title must be unique for each and everyrecord.Based on script below , answer question in photo CREATE TABLE DOCTOR(DOC_ID NUMBER(3),DOC_NAME VARCHAR2(9),DATEHIRED DATE,SALPERMON NUMBER(12),AREA VARCHAR2(20),SUPERVISOR_ID NUMBER(3),CHGPERAPPT NUMBER(3),ANNUAL_BONUS NUMBER(5),CONSTRAINT DOCTOR_DOC_ID_PK PRIMARY KEY (DOC_ID)); CREATE TABLE PATIENT(PT_ID NUMBER(3),PT_LNAME VARCHAR2(15),PT_FNAME VARCHAR2(15),PTDOB DATE,DOC_ID NUMBER(3),NEXTAPPTDATE DATE,LASTAPPTDATE DATE,CONSTRAINT PATIENT_PT_ID_PK PRIMARY KEY (PT_ID),CONSTRAINT PATIENT_DOC_ID_FK FOREIGN KEY(DOC_ID)REFERENCES DOCTOR); INSERT INTO DOCTOR VALUES(432, 'Harrison' , TO_DATE('05-DEC-94'), 12000,'Pediatrics', 100, 75, 4500);INSERT INTO DOCTOR VALUES(509, 'Vester' , TO_DATE('09-JAN-00'), 8100,'Pediatrics', 432, 40, null);INSERT INTO DOCTOR VALUES(389, 'Lewis' , TO_DATE('21-JAN-96'), 10000,'Pediatrics', 432, 40, 2250);INSERT INTO DOCTOR VALUES(504, 'Cotner' , TO_DATE('16-JUN-98'), 11500,'Neurology', 289, 85, 7500);INSERT INTO DOCTOR VALUES(235, 'Smith' ,…Write a query against QrderDetails Table, that returns the running quantity for each order using subqueries. Note: Use Database and tables created in given code . In Tsql CREATE TABLE Categories ( CategoryID int NOT NULL, CategoryName varchar(255), PRIMARY KEY (CategoryID)); CREATE TABLE Products ( ProductID int NOT NULL, ProductName varchar(255), MobileNumber varchar(255), ProductImage image, UnitCost int , Description varchar(255), CategoryId int,PRIMARY KEY (ProductID),FOREIGN KEY (CategoryId) REFERENCES Categories(CategoryId) ); CREATE TABLE Review( ReviewID int NOT NULL, ProductID int NOT NULL, CustomerName varchar(255), CustomerEmail varchar(255), Rating int, Comments varchar(255), PRIMARY KEY (ReviewID),FOREIGN KEY (ProductID) REFERENCES Products(ProductID) ); CREATE TABLE ShoppingCart( RecordID int NOT NULL, CartID int NOT NULL, ProductID int NOT NULL, quantity int, DataCreated varchar(255), PRIMARY KEY (RecordID),FOREIGN KEY (ProductID)…
- Database Q1: Which one of the following INSERT statements will successfully insert a single row? The following table has been created: CREATE TABLE student_table ( stud_id NUMBER (6), last_name VARCHAR2 (20), first_name VARCHAR2 (20), lunch_num NUMBER (4) ; a) INSERT VALUES INTO student_table (143354, ‘Roberts’, ‘Cameron’, 6543); b) INSERT INTO student_table COLMUNS (stud_id, last_name, lunch_num) VALUES (143352, ‘Roberts’, 5543, ‘Cameron’); c) INSERT TO student_table (stud_id, lunch_num, first_name, last_name) VALUES (143352, 6543, ‘Cameron’, ‘Roberts’); d) INSERT INTO student_table VALUES (143354, ‘Roberts’, ‘Cameron’, 6543); Q2: What does the following SQL statement display: SELECT EMP_ID, LAST_NAME, SALARY FROM EMPLOYEES WHERE SALARY > (SELECT MIN (E. SALARY) FROM EMPLOYEES E) ORDER BY SALARY DESC; a) Employees information who earn less money than the maximum salary b) Employees information who earn more money than the highest employee salary c) Employees information who earn…Write a query against OrderDetails Table, that returns the running quantity for each order using subqueries don't copy the solution bartley as its wrong Note: Use Database and tables created in given code . In Tsql CREATE TABLE Categories ( CategoryID int NOT NULL, CategoryName varchar(255), PRIMARY KEY (CategoryID)); CREATE TABLE Products ( ProductID int NOT NULL, ProductName varchar(255), MobileNumber varchar(255), ProductImage image, UnitCost int , Description varchar(255), CategoryId int,PRIMARY KEY (ProductID),FOREIGN KEY (CategoryId) REFERENCES Categories(CategoryId) ); CREATE TABLE Review( ReviewID int NOT NULL, ProductID int NOT NULL, CustomerName varchar(255), CustomerEmail varchar(255), Rating int, Comments varchar(255), PRIMARY KEY (ReviewID),FOREIGN KEY (ProductID) REFERENCES Products(ProductID) ); CREATE TABLE ShoppingCart( RecordID int NOT NULL, CartID int NOT NULL, ProductID int NOT NULL, quantity int, DataCreated varchar(255),…CREATE TABLE EMPLOYEE(ENUM DECIMAL(12) NOT NULL,/* Employee number */FNAME VARCHAR(50) NOT NULL,/* First name */LNAME VARCHAR(50) NOT NULL,/* Last name */DOB DATE NULL,/* Date of birth */CONSTRAINT EMPLOYEE_PKEY PRIMARY KEY(ENUM) );CREATE TABLE DRIVER(ENUM DECIMAL(12) NOT NULL,/* Employee number */LNUM DECIMAL(8) NOT NULL,/* Driving license number */STATUS VARCHAR(10) NOT NULL,/* Driver status */CONSTRAINT DRIVER_PKEY PRIMARY KEY(ENUM),CONSTRAINT DRIVER_UNIQUE UNIQUE(LNUM),CONSTRAINT DRIVER_FKEY FOREIGN KEY(ENUM) REFERENCES EMPLOYEE(ENUM),CONSTRAINT DRIVER_STATUS CHECK (STATUS IN ('AVAILABLE', 'BUSY', 'ON LEAVE')) );CREATE TABLE TRUCK(REGNUM VARCHAR(10) NOT NULL,/* Registration number */CAPACITY DECIMAL(7) NOT NULL,/* Capacity */WEIGHT DECIMAL(7) NOT NULL,/* Weight */STATUS VARCHAR(10) NOT NULL,/* Present status */CONSTRAINT TRUCK_PKEY PRIMARY KEY(REGNUM),CONSTRAINT TRUCK_STATUS CHECK( STATUS IN ('AVAILABLE', 'USED', 'MAINTAINED')),CONSTRAINT TRUCK_WEIGHT CHECK( WEIGHT > 0.0 AND…