Suppose that you want a table listing for the following conditions: the V CODE is either 25595 or 24288 and the P_PRICE is greater than $100. Write a SQL query to generate this table listing for the P_DESCRIPT, P_PICE and V_CODE.
Q: Code a query that will make use of SQL Server intrinsic functions and reference the Instructors…
A: SELECT (FirstName + ' '+LastName)AS Instructor_Name,YEAR(HireDate)AS…
Q: Given the schema: department(department_id, department_name) employees (employee_id, first_name,…
A: Given the Schema we have to write SQL query.
Q: Now write a query which make use of equijoin to display the output as follows: Output Amani CS306…
A: I have provided a solution in step2.
Q: Employee_id Name Salary 1001 Annie 6000 1009…
A: SELECT * FROM employee WHERE employee_id>1009 employee_id will be 1018 And output will be…
Q: Using the university schema, write an SQL query to find the number of students in each section. The…
A: SQL Query: SELECT s.course_id, s.sec_id, s.year, s.semester, count(id) AS numFROM takes t, section…
Q: Write the SQL code that will create only the table structure for a table named EMP_1. This table…
A: SQL commands to create a table: CREATE TABLE: This command is used to create a table structure in…
Q: QL Help I need to create a PL/SQL trigger called aprove_rental that will prevent an INSERT if a…
A: Code create table client (client_num char(4), client_lname varchar2(15) not null, client_fname…
Q: Guest details and Total Charges paid Develop a simple SQL query Display guest details who paid total…
A: According to the given table schema and problem statement out task is to develop a SQL query a to…
Q: 3) Write an SQL query to display the accountno, name, Recurrent_acno, transaction_date whose Fixed…
A: Required:
Q: Use sub queries to answer the following Q1) write a query to display the employees first name and…
A: Note:- since table name is not we had given queries according to question given Syntax: select…
Q: Write an SQL query to List the product description from the table named m_product, ordered_quantity…
A: Since the question does not specify which SQL platform(Oracle,MySQL,MS-SQL Server) , MS -SQL Server…
Q: Create a PL/SQL query to display the invoice number, coin name, coin price and delivery notes. In…
A: create the table Bill which contains the following fields, Bill number product price delivery note…
Q: You have to only develop a SQL query Write a query to display the resort name, rate of all the…
A: Here have to determine about sal query for given scenario.
Q: Write a T-SQL query to display the emp code, emp lname, employee job code, from the employee table…
A: Screenshot- DB is designed as per the SQL create DB and insert statements.
Q: 6. Write the SQL code to validate the ASSIGN_CHARGE values in the ASSIGNMENT table. Your query…
A: The first query should validate the the ASSIGN_CHARGE values in the ASSIGNMENT table. ASSIGN_CHARGE…
Q: Complete PL/SQL function below, which will return last name of employee whose id is equals to 2…
A: The above question is solved in step 2:-
Q: Which of the following tables is followed by the outer join operator (+) in an OUTER JOIN query?
A: Given; Which of the following tables is followed by outer join operator in an OUTER JOIN query
Q: Select clause: Display the columns specified above in the problem statement From: LGPRODUCT Where…
A: SQL is a structured query language, that's is used to extract and manipulate the data from the…
Q: 3- Write a query to display the customer code, balance, and total purchases for each customer. Total…
A: Actually, SQL is a language to operate databases in searching and filtering the data according to…
Q: Given the following table TABLE CUSTOMER Column Null? Туре CUS_ID NOT NULL NUMBER NAME VARCHAR2(50)…
A: In SQL, the SELECT statement can be applied to fetch records from any relation. It can display…
Q: Create a PL/SQL query to display the combined customer name, coin purchased, coin price and the…
A: SQL Query: Query Output:
Q: Create table sales ( cust varchar(20), prod varchar(20), day integer, month integer, year integer,…
A: Answer
Q: Create a SQL query that selects OrderID and OrderDate from the Orders database and OrderDetailID…
A: Definition A JOIN clause is used to join data from more than "2" tables together based on a common…
Q: 1. Write a query to display customer name, product and category with prices between 5 and 25…
A: 1) Query to display customer name , product , category and price in between 5 and 25. SELECT…
Q: Create a Query with all products information whose price is >20.
A: Lets see the solution.
Q: Select clause: Display the columns stated in the problem statement From clause: AUTHOR table…
A: SQL is a structured query language, that's is used to extract and manipulate the data from the…
Q: a) Write the standard SQL query to retrieve all information about the customer whose customer number…
A: Here is the Answer and Explanation
Q: Write a query to display the mobile model name which has made the maximum sales. Give an alias for…
A: According to the given question here we have to develop a SQL code that display the mobile model…
Q: Having created the table structure in Problem 1, write the SQL code to enter the first two rows for…
A: Having created the table structure in Problem 1, write the SQL code to enter the first two rows…
Q: Teomdate Display guest details who paid total charges RS.50000 and above. Write a query to fetch…
A: To write a query to fetch Guest id, Guest name and Sum of total charges. Give alias name to total…
Q: a. Find all movies with a cost less than or equal to the average moVies cost b. Write a query to…
A: Select Query: It will retrieve data from the table. select * from table name;…
Q: edit the sql below to display the building location that has the most computers. select…
A: To display the building location that has the most computers. Given query: select bldg_code from…
Q: Write an SQL query using the ALTER TABLE and ADD operator to add anattribute named ORDERDATE with…
A: ALTER TABLE command: The ALTER TABLE command is used to add new columns, modify columns in an…
Q: Write the SQL code to validate the ASSIGN_CHARGE values in the ASSIGNMENT table. Your query should…
A: ORDER BY Clause: SQL contains “ORDER BY” clause in order to sort rows. The values get sorted in…
Q: Write an SQL query using the IN operator to show all customers residingin the following zip codes:…
A: As the database is not given we have assumed the database CUSTOMERS. SQL query to create table…
Q: Write a query to display the eight departments in the LGDEPARTMENT table sorted by department name.…
A: Given that write a query to display the eight departments in the LGDEPARTMENT table sorted by name .…
Q: Write the SQL code to validate the ASSIGN_CHARGE values in the ASSIGNMENT table. Your query should…
A: UPDATE ASSIGNMENT SET CALC_ASSIGN_CHARGE = ASSIGN_CHG_HR* ASSIGN_HOURS;
Q: Write an SQL query that will select OrderID and OrderDate from theOrders table and OrderDetailID…
A: To combine rows from more than “2” tables based on a related column between them, a JOIN clause is…
Q: Write a SQL query that selects OrderID and OrderDate from the Orders table and OrderDetaillD from…
A: Introduction: Structured Query Language (SQL) is an acronym for Structured Query Language. SQL is a…
Q: Use this info to answer the question TABLE NAME: students COLUMNS: student-no NUMBER(6) fname…
A: Given Table name: Students Columns to display: studentno, fname, lname Condition: all Female…
Q: Q11. Write an SQL query to do the following: a. Create table customer_info with the given details.…
A: Using CREATE statement we can create table in SQL. Syntax: CREATE TABLE Table_Name(Column1_Name…
Q: Write an SQL query using the UPDDATE and SET operator that willoverwrite all values containing 16…
A: Update statement: The UPDATE statement in the SQL is used to modify existing records present in the…
Q: Write the SQL 9. Create an index called CUSTOMERIND on the CUSTID column in the CUSTOMER table
A: As per question statement we need to write sql statement to create index CUSTOMERIND on the CUSTID…
Q: Write a query in SQL code for: "List the book categories and the average book price of each…
A: Select: Select is used to display columns or attributes that are to shown as a result of the…
Q: Create a SQL query to display the combined customer name, employee id, delivery notes, coinordered…
A: Answer:)
Q: Write a T-SQL correlated subquery selecting the store code, store name, store ytd sales from the…
A: Given: Four tables, Employee, Job, Region, and Store including certain attributes Objective: We need…
Step by step
Solved in 2 steps
- _&plase helo with Course: Database *(SQL)* Please excute the given SQL script (https://drive.google.com/file/d/1zxe_aOhERjVCL54_zbgSLkFTRHYQhOPW/view?usp=sharing) for accessing the data. The data is described in the following relation schemas: Airport (airportID, name, city) Passenger (ticketNo, name, nationality, flightNo, seatNo)FK: flightNo references Flight (flightNo)FK: seatNo references Seat (seatNo) Flight (flightNo, flightCompany, departAirport, arrivalAirport)FK: departAirport references Airport (airportID)FK: arrivalAirport references Airport (airportID) Seat (seatNo, flightNo, class)FK: flightNo references Flight (flightNo) #Construct the SQL statements based on following transactions:1. Retrieve all rows in Airport table for all the airports in London city.2. Retrieve all British and German passengers.3. Retrieve all names of all the passengers..A database has 4 transactions, shown below.TID Date items_boughtT100 10/15/04 {K, A, D, B}T200 10/15/04 {D, A, C, E, B}T300 10/19/04 {C, A, B, E}T400 10/22/04 {B, A, D}Assuming a minimum level of support min_sup = 60% and a minimum level ofconfidencemin_conf = 80%:(a) Find all frequent itemsets (not just the ones with the maximum width/length) using the Apriori algorithm. Show your work—just showing the final answer is not acceptable. For each iteration show the candidate and acceptable frequent itemsets. You should show your work similar to the way the example was done in thePowerPoint slides.(b)List all of the strong association rules, along with their support and confidence values, whichmatch the following metarule, where X is a variable representing customers and itemi denotes variables representing items (e.g., “A”, “B”, etc.).x transaction, buys(X, item1) buys(X, item2) buys(X, item3)Hint: don’t worry about the fact that the statement above uses relations. The point of the…In a database, there are values a data element can take, and there are values it cannot take. In other words, data element values should be within correct ranges. For example, ages of employees should be between 18 and 80. Which one of the following database features ensures that? a) Security b) Data Integrity c) Data Sharing d) Concurrency Control e) Data Independence Which one/ones of the following uniquely distinguishes the tuples of a relation? a) primary key b) super key c) candidate key d) alternate key e) foreign key f) a, c, and e g) a, b, c, d, and e. h) a, b, c, and d. Which one(s) of the following may exist more than once for a relation? a) primary key b) super key c) candidate key d) alternate key e) foreign key f) a, b, and c g) b, c, and d h) b, c, d, and e h) a, b, c, and d. i) a, b, c, and e j) a, b, c, d, and e. In the…
- create Database CTU_YOURICASNOGOUSE CTU_YOURICASNO;GOCREATE TABLE Course( CourseID int PRIMARY KEY, CourseName varchar(255), CourseDesc varchar(255),);CREATE TABLE Students( ICASNo int Primary Key, StudentName varchar (255)NOT NULL, StudentSurname varchar (255)NOT NULL, StudentContact varchar (255)NOT NULL, StudentEmail varchar(255)NOT NULL, HighSchoolAttended varchar(255)NOT NULL, courseID int,);CREATE TABLE Semester( SemesterID int Primary Key, SemesterStartDate varchar(255)NOT NULL, SemesterEndDate varchar(255)NOT NULL, ICASNo varchar(255),);CREATE TABLE Facilitator( FacilitatorID int Primary Key, FacilitatorName varchar(255) Not Null, FacilitatorContact varchar(255)Not Null, FacilitatorEmail varchar(255)Not Null, ICASNo varchar(255)Not Null, ); CREATE TABLE Module( ModuleID int Primary Key, ModuelName varchar(255)Not Null, ModuleDuration varchar(255)Not Null, FacilitatorID varchar(255)Not Null,); Using the…Given the relational database shop defined in the script below; create database shop;use shop; create table users( id int null auto_increment, firstname varchar(255), lastname varchar(255) not null, primary key (id)); create table items( id int null auto_increment, name varchar(255), price float, primary key (id)); create table orders( id int null auto_increment, id_users int not null, id_items int not null, primary key (id), foreign key (id_users) references users(id), foreign key (id_items) references items(id)); write three SQL queries to answer the following questions 1.- All products(items) in the shop catalog; product code, name and price 2.- Products sold in the shop; product code, name and price and full name of buyer. 3.- Products in stock (not sold); product code, name and price6. In an e-commerce site, a seller decides to provide an M% discount on his XYZ company's those products where the product quantity is greater than 65 in the database. Implement the server-side of the web page in PHP and MySQL. The database tables must be illustrated with the code. [Here, M is the last digit of your ID] InformationId:0And Please proivide Right ans in short.
- Which of the following is a document database? a. MongoDB b. Base c. Neo4J d. InfluxDB We have an itemset I whose support is 20. Further we know that seven of the sets that contain I also contain j. What is the confidence of the association rule I→j? a. 7/20 b. 20/7 c. 13/20 d. 7/13Give a relational database schema for the following: EMPLOYEE (Fname, Minit, Lname, SSN, Bdate, Address, Sex, Salary, Super_ssn, Dno) PK= Ssn FK= Super_ssn DEPARTMENT ( Dnamc, Dnumbcr, Mgr_ssn, Mgr_start_datc) PK= Dnumbcr FK= Dno DEPT_LOCATIONS (Dnumber, Dlocation) PK= Dnumber FK= Dnumbcr PROJECT (Pname, Pnumber, Plocation, Dnum) PK= Pnumber FK= Pno WORKS_ON (Essn, Pno, Hours) PK= Pno FK= ssn DEPENDENT (Essn, Dependent_name, Sex, Bdate, Relationship) PK= Essn FK= SsnBased on the following database schemas: Homestay (homestayNo (PK), homestayName, address, telNo, city)Room (roomNo, homestayNo (PK), type, price)Booking (homestayNo, guestNo (PK), dateFrom, dateTo, roomNo) Guest (guestNo (PK), guestName, guestAddress, guestTelNo) Assume the following indexes exist:a) a hash index with no overflow on the roomNo and homestayNo as a composite primary key in Room;b) a clustering index on the foreign key attributes homestayNo in Room;c) a B⁺-tree index on the price attribute in Room;d) a secondary index on the attribute type in Room. nTuples(Room) = 20000 bFactor(Room) = 200nTuples(Homestay) = 100 bFactor(Homestay) = 40nTuples(Booking) = 100000 bFactor(Booking) = 60nDistincthomestayNo(Room) = 50 nDistinctroomNo(Booking) = 150nDistincttype(Room) = 10…
- Based on the following database schemas:Homestay (homestayNo (PK), homestayName, address, telNo, city)Room (roomNo, homestayNo (PK), type, price)Booking (homestayNo, guestNo (PK), dateFrom, dateTo, roomNo)Guest (guestNo (PK), guestName, guestAddress, guestTelNo)Assume the following indexes exist:a) a hash index with no overflow on the roomNo and homestayNo as a composite primary key in Room;b) a clustering index on the foreign key attributes homestayNo in Room;c) a B+-tree index on the price attribute in Room;d) a secondary index on the attribute type in Room.nTuples(Room) = 20000 bFactor(Room) = 200nTuples(Homestay) = 100 bFactor(Homestay) = 40nTuples(Booking) = 100000 bFactor(Booking) = 60nDistincthomestayNo(Room) = 50 nDistinctroomNo(Booking) = 150nDistincttype(Room) = 10 nDistincthomestayName(Homestay) = 50nDistinctprice(Room) = 500 maxprice(Room) = 500minprice(Room) = 200 nLevelstype(I) = 2nLevelshomestayNo(I) = 2 nLfBlocksprice(I) = 50nLevelsprice(I) = 2 Log2100 = 6.64Log250 =…Database Systems Question 1. A B C D 1 20 M 101 2 21 N 102 3 22 O 103 1 21 M 104 4 22 O 105 Find out which of the following dependencies are valid or not. For each dependency, briefly write the reasons. A -> BCD AB -> C AB -> D D -> ABC BC -> AOur MongoDB database consists of a ‘class’ collection in which documents represent students and have fields ‘name’, ‘age’ and ‘address’. The value of the field ‘address’ is an embedded document with fields ‘number’, ‘street’ and ‘city’. How would you query documents for students from Belfast? a. db.class.find ( { “class.address.city”: “Belfast” } ) b. db.class.find ( { city: “Belfast” } ) c. a) db.class.find ( { “address.city”: “Belfast” } ) d. db.class.find ( { “class.city”: “Belfast” } ) NoSQL is an umbrella term for several databases. These are typically used to address problems with what type of database. a. Object-oriented databases b. XML files c. Relational Databases d. Spreadsheets