Question

How would I write the SQL statement SELECT fname AS First_Name, lname AS Last_Name FROM employee...

How would I write the SQL statement
SELECT fname AS First_Name, lname AS Last_Name
FROM employee
WHERE salary BETWEEN 10000 AND 30000;

in relational algebraic syntax?

0 0
Add a comment Improve this question Transcribed image text
Answer #1

In relational algebra select statement of SQL is performed by π or project operation.

The where clause in SQL is equivalent to σ or select operation in relational algebra.

The rename operator is denoted by ρ symbol.

Hence, the required query in relational algebra is :

π First_Name, Last_Name ( σ ( salary >= 10000salary <= 30000 ) ρ ( First_Name/fname, Last_Name/lname ) ( employee ).

Add a comment
Know the answer?
Add Answer to:
How would I write the SQL statement SELECT fname AS First_Name, lname AS Last_Name FROM employee...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Express the following SQL command in English: SELECT last_name, first_name                 FROM students             &

    Express the following SQL command in English: SELECT last_name, first_name                 FROM students                 WHERE first_name LIKE 'D%' OR last_name LIKE '%n';

  • What is wrong with the following SQL statement? select first_name , last_name , phone from Customer,...

    What is wrong with the following SQL statement? select first_name , last_name , phone from Customer, Orders where customer.customerid = orders.customerid; Group of answer choices 1 You cannot join customer.customerid to orders.cutomerid 2 Nothing is wrong with this statement. 3 The join is wrong. You can only join tables in the FROM clause. 4 The result will be a Cartesian Product.

  • I need this written in SQL Employee EMP ID EMP FNAME EMP LNAME EMP STREET EMP...

    I need this written in SQL Employee EMP ID EMP FNAME EMP LNAME EMP STREET EMP CITY EMP STATE EMP ZIP EMP START DATE Table TABLE ID AREA IDTABLE SEATS Area AREA ID AREA NAME AREA SUPERVISOR EMPLOYEE ID Customer CUST ID CUST LAST NAME CUST NUMBER OF GUESTS Assignment EMPID TABLE ID Seating CUST IDTABLE ID SEATING COST SEATING DATE SEATING TIP Question 29 (10 points) Write an SQL query to list the employee ID and first and last...

  • 1) Write or select the correct SQL statement that satisfies the following case: Change record with...

    1) Write or select the correct SQL statement that satisfies the following case: Change record with value 'Nick' to 'Cuba' for the 'Last Name' attribute in the table 'Vendors' A. UPDATE VENDORS SET LAST_NAME='CUBA' WHERE LAST_NAME=NICK B.INSERT INTO LAST_NAME VALUES("NICK"); C.INSERT INTO 'NICK' VALUES('VENDORS'); D. INSERT INTO VENDORS WHERE LAST_NAME="NICK" 2) Write or select the correct SQL statement that satisfies the following case: Change record with value 'Gary' to 'Jada' for the 'Style' attribute in the table 'Invoice_Line' A. INSERT...

  • QUESTION 27 The SET command is used in which statement UPDATE SELECT DISTINCT DELETE FROM INSERT...

    QUESTION 27 The SET command is used in which statement UPDATE SELECT DISTINCT DELETE FROM INSERT VALUES QUESTION 28 Which view would you use to see only the tables you have created ALL_TABLES USER_TABLES USER_TABS ALL_OBJECTS QUESTION 29 Which command should you use to write logical units of work to disk permanently SAVEWORK COMMIT ROLLBACK INSERT QUESTION 30 A Top-N Analysis is capable of ranking a top or bottom set of results. True False QUESTION 31 If you are performing...

  • Write a T-SQL query to display the emp code, emp lname, employee job code, from the...

    Write a T-SQL query to display the emp code, emp lname, employee job code, from the employee table joining the job table where the employee job code equals the job table job code. Order the output by employee job code. Copy and paste the query and the output into your assignment document. (hint: use table aliases).

  • Employee        (empID, fName, lName, address, DOB, sex, position, deptNo)             Department     (deptNo, deptName, mgrEmpID)   

    Employee        (empID, fName, lName, address, DOB, sex, position, deptNo)             Department     (deptNo, deptName, mgrEmpID)             Project            (projNo, projName, deptNo)             WorksOn         (empID, projNo, hoursWorked)             where Employee        contains employee details and empID is the key.                         Department     contains department details and deptNo is the key. mgrEmpID identifies the employee who is the manager of the department. There is only one manager for each department.                         Project            contains details of the projects in each department and the...

  • Write an SQL statement to join EMPLOYEE, ASSIGNMENT, and PROJECT using the JOIN ON syntax. Run...

    Write an SQL statement to join EMPLOYEE, ASSIGNMENT, and PROJECT using the JOIN ON syntax. Run this statement. Write an SQL statement to join EMPLOYEE and ASSIGNMENT and include all rows of EMPLOYEE in your answer, regardless of whether they have an ASSIGNMENT. Run this statement. I have been working on these two questions for the last 3 hours and I cannot get Microsoft Access 2016 to Run them without an error message coming up.

  • schema book: book_id, book_name, author_id. Author: author_id, first_name, last_name. DOB, social. i am trying to write...

    schema book: book_id, book_name, author_id. Author: author_id, first_name, last_name. DOB, social. i am trying to write a query that lists the first and last name of each author and counts how many books they wrote if they wrote more than one. but i am having issue . this is what i have so far, select book_name, count(b.book_name) as "number of books" from book b join author a on (b.author_id = a.author_id) group by b.book_name having count (a.author_id) >1;

  • (SELECT pnumber FROM project, department, employee WHERE dnum=dnumber AND mgr_ssn=ssn AND lname='Smith') UNION (SELECT pnumber FROM...

    (SELECT pnumber FROM project, department, employee WHERE dnum=dnumber AND mgr_ssn=ssn AND lname='Smith') UNION (SELECT pnumber FROM project, works_on, employee WHERE pnumber=pno AND essn=ssnAND lname='Smith') Can you draw the relation step by step , how to solve it ?! Figure 5.6 One possible database state for the COMPANY relational database schema. EMPLOYEE Sex Salary Super ssn Dno B Smith 123456789 1965-01-09 731 Fondren, Houston, TX M 30000 3334455555 Ssn Fname Minit Lname John Franklin TWong 333445555 1955-12-08 638 Voss, Houston, TXM40000...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT