A few sql guys help me take a look

Updated on collection 2024-05-10
4 answers
  1. Anonymous users2024-02-10

    First of all, you have a problem in the title, that is, the first one should be the department table, I assume it is called d emp.

    Question A Answer:

    select t_ from t_emp,d_emp where d_'A piece of software' and t_。

    Explain this sentence: Where do you find the employee's name first? What are the conditions for finding from the two tables of t emp and d emp?

    The condition is d'A piece of software', that is, the department is a part of the software, and the last sentence is to connect the two tables and connect them by the department number.

    Question B Answer:

    insert into t_emp(emp_id dept_id emp_name) values (888,111,'Xiao Li')。

    Question C Answer:

    I really forgot about this, I forgot how to display it in a tree structure, and this seems to depend on what database you're using.

  2. Anonymous users2024-02-09

    Define the name of the first department table as d emp

    The second employee form T emp

    A answer. select * from t_emp where dept_id in(002,003,004 )

    B answer. insert into t_emp (emp_id,dept_id,emp_name) values ('888','111','Xiao Li')

    insert into d_emp(dept_id,p_deptid,dept_name)values('111','001','111 Division')

    C answer. -Firm.

    select * from d_emp where p_deptid =0

    All departments under the company.

    select * from d_emp where p_deptid =001

    All subordinate departments under each department.

    select * from d_emp where dept_id in(select p_deptid from d_emp where p_deptid =001)

  3. Anonymous users2024-02-08

    The table is wrong, right? Suppose the following table is available:

    t dep --departmental table).

    t emp -- staff table) then :

    a : select emp_name from t_emp where dept_id = '002'

    or : select emp name from t emp where dept id in (select dept id from t dep where dept name =.)'A piece of software')

    b : insert into t_dep(dept_id p_deptid dept_name) values ('111','001','111 Division

    insert into t_emp(emp_id dept_id emp_name) values ('888','111','Xiao Li')

    C : Select Company A, dept name from t dep where p deptid like'0%'

    table emp

    eno varchar(20),ename varchar(20),salary varchar(20),dno varchar(20) )

    create table emp

    dno varchar(20),dname varchar(20),manager varchar(20) )

  4. Anonymous users2024-02-07

    How are the 2 table names the same?

    Question 1: Suppose the first one is Table A and the second one is B

    select b.* from b join a on where '002'

Related questions
2 answers2024-05-10

Your graphics card is indeed a bit outdated, and the 9400GT is really not good for gaming. >>>More

12 answers2024-05-10

It's annoying to the emotion, and then it's actually very normal, many times the relationship is a headache, and there will be one question or another.

7 answers2024-05-10

Li Xiaolu - Hopeless love.

**: Oriental beauty. >>>More

7 answers2024-05-10

The body temperature is normal and it should be nothing. Because like those more serious diseases, such as dog plague, the first symptoms will be fever. Small ones will have diarrhea, and little babies don't have these symptoms. >>>More

44 answers2024-05-10

Your description is too simple, a smart phone doesn't just look at these parameters. >>>More