Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Collection of Oracle written interview questions in the database (from the network)

2025-03-26 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Collection of Oracle written interview questions in the database (from the network)

Question:

1. Explain the differences and advantages of cold backup and hot backup.

2. Explain the differences between archiving and non-archiving modes and their respective advantages and disadvantages?

* *

Answer:

1. Explain the differences and advantages of cold backup and hot backup.

A:

1. Differences:

Hot backup: for a database in archive mode, make a backup while the database is working

Cold backup: for all mode databases, back up after the database is shut down.

2. Their respective advantages:

Hot backup: when backing up, the database can still be used and can be restored to any point in time

Cold backup: its backup and recovery operation is quite simple, and because the cold backup database can work in non-archive mode and does not have to write archive logs to the hard disk, the database performance will be slightly better than the archive mode.

Memory mode: hot backup > archiving mode > working time > restoring any point in time

Cold backup > all modes > on shutdown > slightly improve performance

2. Explain the differences between archiving and non-archiving modes and their respective advantages and disadvantages?

Answer: archive mode means that all database transactions can be backed up and restored to any point in time.

Non-archive mode, on the other hand, cannot be restored to any point in time.

However, non-archiving mode can bring a slight improvement in database performance.

Memory mode: archive mode > hot backup > restore at any point in time > performance degradation slightly

Non-archive mode > cold backup > restore full backup > performance improvement

If you don't accumulate steps, you can't reach a thousand miles.

Question:

1. How to convert to spfile file according to initialization file pfile?

2. What are the states experienced when the database is started normally?

Answer:

1. How to convert to spfile file according to initialization file pfile?

A:

Use the command: SQL > create spfile from pfile.

Parsing:

(1) Overview:

Oracle starts from 9i, and two kinds of parameter initialization files are added, namely, text parameter file and server parameter file. They are loaded when the database instance is started, which determines the physical structure of the database, memory, limitations of the database, a large number of default values of the system, various physical properties of the database, specifying database control file names and paths, and so on. it is an important file for database design and performance tuning.

(2) brief introduction of pfile and spfile

They are all required parameter files.

Pfile: the initialization parameter file, which is an ASCII text file, can be edited directly. Modifications to this kind of file need to be made manually, and the restart of the Oracle instance will not take effect until it is modified.

Spfile: server parameter files, binary files, can not be edited directly.

(3) check whether the system starts with pfile or spfile

Command: SQL > select isspecified,count (*) from v$spparameter group by isspecified

If there is true in isspecified, it indicates that the specified configuration has been done with spfile, and if it is all false, it will be started with pfile.

(4) benefits of using spfile

Spfile corrects the problem of pfile management confusion. In a multi-node environment, pfile will have more than one image to start up and need to track the latest image, which is a tedious process. After using spfile, all parameter changes are written to spfile where there is an authoritative source of parameter configuration.

(5) View spfile location

Command SQL > show parameter spfile

(6) create each other

Spfile and pfile can be created with the following commands:

SQL > create spfile from pfile

SQL > create pfile from spfile.

When the database is created for the first time, the system collects the parameters set by the creator and generates a pfile. After that, when you start the database for the first time, the spfile will be created with this pfile, and the pfile file will no longer be needed. The pfile file will be used the next time you start. If the database does not fail, the pfile file will always be used. However, if the spfile is corrupted or the spfile file needs to be recreated, you can use the pfile file to create a new spfile file.

2. What are the states experienced when the database is started normally?

A:

Database instance startup: NOMOUNT status

Database mount: MOUNTED statu

Database open: OPEN status.

Parsing:

(1) A brief description of examples:

Let me give you a simple example before introducing the launch of the database. if we plan to start a company, we will generally have an initialization plan and sort out the initialization planning ideas into written documents. then recruit experienced managers from relevant departments to form a team, followed by the recruitment of grass-roots staff in each department, such a simple company system is formed.

Starting the oracle database is the same as the example above. When the database starts, you need to find the initialization file (spfile/pfile) first, then the database is in the nomount state, which is equivalent to the initial stage of starting the company. Secondly, you find the control file according to the initial file, and the database is in the mount state, which is equivalent to the management team originally set up when you start the business. After that, the data file is found according to the control file, and the log file is redone, so that it is in the open state, and the user can access the database. It's like a company's system has been initially built.

(2) Experimental verification:

Enter line 1 command: sqlplus/nolog

Description:

Start SQLPLUS without logging in, just enter the sqlplus software, which is equivalent to opening a login window, the user name and password are entered next, so that the following input does not show the password to play a secure role.

Enter line 2 command: conn / as sysdba

Description:

When oracle logs in, there are three kinds of identity authentication: operating system identity authentication, password file authentication and database authentication. Conn / as sysdba belongs to the operating system authentication. The user who logs in when your computer is powered on, that is, the user who enters the operating system, for example, under Win xp is Administrator, which is in the ORA_DBA group of your computer. You can right-click on "my computer", find "Administration", select "Local users and groups", find a group called "ORA_DBA", double-click it, and see "Administrator" in the list of members. That is, conn / as sysdba,oracle will verify the operating system and find that the user you are currently logged in belongs to the Administrator group, so you can log in successfully. You can delete the "Administrator" user in the ORA_DBA group, and then conn / as sysdba, and you will find that you can't get in.

Enter line 3 command: SQL > shutdown;-shutdown

Enter line 4 command: SQL > select status from v$instance

Description:

Query the status of the current instance. V$instance is a view. This state indicates the state of the database after it was started with startup.

Enter line 5 command: SQL > startup nomount;-started

Enter line 6 command: SQL > select status from v$instance

Enter line 7 command: SQL > alter database mount;-mounted

Enter line 8 command: SQL > select status from v$instance

Enter line 9 command: SQL > alter database open;-open

Enter line 10 command: SQL > select status from v$instance

Enter line 11 command: SQL > shutdown

Question:

1. Name two related constraints?

Explain the difference between $ORACLE_HOME and $ORACLE_BASE?

Answer:

1. Answer: primary key and foreign key.

2. Answer: product catalogue of $ORACLE_HOME:oracle

The root directory of $ORACLE_BASE:oracle.

Question:

1. When creating a user, what permissions do you need to grant to the new user to connect to the database?

2. How to classify backups?

Answer:

1. Answer: CONNECT permission.

2. Answer:

First: logical backup and physical backup.

EXP/IMP can be used for logical backup

RMAN can be used for physical backups.

The second kind: hot backup and cold backup.

Hot backup is the backup of the database under normal access, and RMAN backup is also a hot backup.

A cold backup is an offline backup, close the database and back up all the files in the database.

Question:

1. What are the two files used for network connection?

2. What is the role of the database redo log (Redo Logs)?

Answer:

1. Answer: TNSNAMES.ORA and SQLNET.ORA

2. Answer: Redo Logs is a physical and logical structure used to store data changes in the database, which can be used to repair the database.

1. What is the difference between temporary and permanent tablespaces?

2. Explain the difference between Function, Procedure and Package?

Question:

1. Answer:

Temporary tablespaces (Temporary Tablespace): for temporary objects

Permanent table space (Permanent Tablespace): used to store existing objects, such as tables, rollback segments, and so on.

2. Answer:

Function and Procedure are collections of PL/SQL code, usually in order to accomplish a task

Procedure does not need to return any value while Function will return a value.

Package is a collection of Function and Procedure to complete a business function.

Question:

1. Briefly describe the differences among data block, extent and segement of the database.

2. Why should I use the index?

Question:

1. Answer:

Data block is the smallest logical storage unit in the database. When the objects in the database need more physical storage space, contiguous data block forms the extent. All the extents owned by a database object is called the segment of that object.

2. Answer:

You can quickly access the data block in the table, that is, you can speed up the access to data.

Question:

1. Briefly describe the relationship between tablespace and datafile.

2. What view is used to determine the remaining space of the tablespace?

Question:

1. Answer:

A tablespace can have one or more datafile

Each datafile can only be in one tablespace.

The data in table is distributed in each datafile in tablespace by hash algorithm.

Tablespace is a logical concept, while datafile physically stores various objects in the database.

2. Answer:

DBA_FREE_SPACE .

Question:

1. Compare the difference between truncate and delete commands?

2. If you must use backup to restore the database, but there are no control files at this time, how to deal with it?

Question:

1. Answer:

Both can be used to delete all records in the table.

Truncate is a DDL operation that moves HWK and does not require rollback segment.

Delete is a DML operation that requires rollback segment and takes a long time.

2. Answer:

Rebuild the control file and restore the database with the recover command with the backup control file clause.

1. What are the constraints of oracle database?

2. The primary key of the table is very similar to the unique constraint. What are the differences?

Question:

1. Answer:

There are five constraints: primary key, foreign key, non-empty, unique, and condition.

Explanation:

Non-null: the value of this column cannot be empty (NOT NULL)

Unique: the value of this column is unique in the table and cannot be repeated, but can be a null value (NULL)

Condition: the value of the column can be set within a certain range of conditions, for example, the age of a person cannot be negative, and the condition of this column can be greater than 0 and less than 200

Primary key: primary, which is a collection of rows or columns in a relational database table. It uniquely identifies a row in a database table. Primary key cannot contain null value (NULL)

Foreign key: foreign. A foreign key is a column or combination of columns in a relational database table. Its value may match a column or columns of another table, which is the primary key of another table.

2. Answer:

The primary key of a table is that the value of the column is the unique identity in the table and cannot be NULL, while the only constraint of the table is that the value of the column exists uniquely in the table and can be null (NULL).

1. What is the function of the log?

2. What is RMAN?

Question:

1 、

A:

Record database transactions to maximize the consistency and security of data.

Redo log files: contains records of changes made to the database, so that data recovery can be enabled in the event of a failure, and a database requires at least two redo log files.

Archive log files: offline copies of redo log files that may be necessary to recover from media failures.

2 、

A:

RMAN (Recovery Manager) is an important tool for DBA to back up, restore and restore databases. RMAN can be used to back up and restore database files, archive logs, control files, system parameter files, and can also be used to perform complete or incomplete database recovery.

Question:

1. How many user interfaces are available for RMAN?

2. Describe the characteristics of RMAN?

Question:

1. Answer:

RMAN has three different user interfaces: COMMAND LINE mode, GUI mode and API mode.

Explanation:

Backup Manager integrated in OEM with GUI mode

The API method is used to integrate into third-party backup software.

2. Answer:

RMAN has the following characteristics:

1 is similar to physical backup, but N times more powerful than physical backup. 2 can compress the air quickly. 3 increments can be achieved at the block level. 4 you can package the backup output into a backup set, or you can split the backup set according to a fixed size. 5 the process of backup and recovery can be managed automatically. 6 you can use scripts (which exist in Recovery Catalog). (7) bad block monitoring can be done.

1. The following logical structures that do not belong to ORACLE are ()

A, Zone

B, paragraph

C, data file

D, tablespace

Answer: C

2. Which of the following users does not exist after the default installation of ORACLE ()

A 、 SYSDBA

B 、 SYSTEM

C 、 SCOTT

D 、 SYS

Answer: a

3. Which of the following actions causes the user to connect to the ORACLE database, but cannot create a table ()

A. The role granted to CONNECT, but not to RESOURCE

B. there is no role granted to the user as a system administrator

C. The database instance is not started

D. Database monitoring did not start.

Answer: a

4. The () function is usually used to calculate cumulative rankings, moving averages and report aggregations.

A, summary

B, Analysis

C, grouping

D, single line

Answer: B

5. SELECT statements with the word () can place exclusive locks in one or more rows of the table.

A 、 FOR INSERT

B 、 FOR UPDATE

C 、 FOR DELETE

D 、 FOR REFRESH

Answer: B

6. In Oracle, you log in as SYSDBA, and the CUSTOMER table is located in the Mary user scheme. Which statement below creates a synonym for the CUSTOMER table for all users in the database ().

A 、 CREATE PUBLIC SYNONYM cust ON mary.customer

B 、 CREATE PUBLIC SYNONYM cust FOR mary.customer

C 、 CREATE SYNONYM cust ON mary.customer FOR PUBLIC

Cannot create a common synonym for CUSTOMER.

Answer: B

7. In Oracle, when the FETCH statement gets data from a cursor, the following statement is correct ().

A, cursor open

B, cursor close

C, the data of the current record is loaded into the variable

D. Create variables to save the data of the current record

Answer: C

In Oracle, the table VENDOR contains the following:

VENDOR_ID NUMBER Primary Key

NAME VARCHAR2 (30)

LOCATION_ID NUMBER

ORDER_DT DATE

ORDER_AMOUNT NUMBER (8 dint 2)

The following is legal to apply the clause of the grouping function to the table VENDOR.

A, FROM MAX (order_dt)

B, SELECT SUM (order_dt)

C, SELECT SUM (order_amount)

D, WHERE MAX (order_dt) = order_d

Answer: C

9. In Oracle, the table EMP contains the following:

……

NAME VARCHAR2 (20)

ADDR VARCHAR2 (60)

……

To return data in NAME's address is ADDR format, the following SQL statement is correct (). Do To_number () on both sides of +

A, SELECT NAME +''s address is'+ ADDR FROM EMP

B, SELECT NAME | |''s address is'| | ADDR FROM EMP

C, SELECT NAME +'\'s address is'+ ADDR FROM EMP

D, SELECT NAME | |'\'s address is'| | ADDR FROM EMP

Answer: B

10. In Oracle, the following is not part of the collection operator is ().

A 、 UNION

B 、 SUM

C 、 MINUS

D 、 INTERSECT

Answer: B

11. In Oracle, the table partitioning method () recommends that the number of partitions is a power of 2 (2, 4, 8, etc.) to get the most average data publication.

A, range partition

B, list partition

C, hash partition

D, compound partition

Answer: C

12. In Oracle, the following description of locks is incorrect ().

A. locks are used to control concurrent access to data between users

B. Locks can be classified as row-level locks and table-level locks

C, insert, update, delete statements automatically acquire row-level locks

D. only one user can lock a specific table at a time

Answer: d

In Oracle, the sequence venseq is created using the following statement:

CREATE SEQUENCE venseq INCREMENT BY 1 START WITH 10

MAXVALUE 100 MINVALUE 10 CYCLE CACHE 5

The following statement modified on the sequence venseq is wrong ().

A 、 ALTER SEQUENCE venseq START WITH 1

B 、 ALTER SEQUENCE venseq MAXVALUE 90

C 、 ALTER SEQUENCE venseq NOMINVALUE

D 、 ALTER SEQUENCE venseq NOCACHE

Answer: a

14. In Oracle, create a view using the following statement:

CREATE OR REPLACE VIEW pen_view

AS SELECT * FROM order_master

WHERE ostatus ='p 'WITH CHECK OPTION CONSTRAINT penv

When the user attempts to execute the following statement: UPDATE pen_view SET ostatus=' d'WHERE ostatus='p'; the following description is correct ().

A, Oracle modify ostatus to d without prompting any errors

B, Oracle do not perform update operation and return error message

C, Oracle modify ostatus to d and return error message

D, Oracle do not perform update operations and do not prompt any errors

Answer: B

15. In Oracle, better performance can be achieved by establishing bitmap indexes in the following situations ().

A. create on a column with a unique column value

B. set up on columns with little difference in column values

C. set up on columns where the column values are frequently repeated

D. create on the column used to save the bitmap

Answer: C

In Oracle, the lock can be released with the command ().

A 、 INSERT

B 、 DELETE

C 、 ROLLBACK

D 、 UNLOCK

Answer: C

17. In Oracle, the following description of clusters is incorrect ().

A, cluster is a set of tables that have common columns and are often used together

B. clustering can improve the performance of INSERT statements compared to storing each table and its index separately.

C. Because all rows in the cluster table use the same column as the common primary key, these columns are stored only once for all tables, thus saving storage space

D. frequently updated columns should not be selected as cluster keys

Answer: B

In Oracle, the () operator allows references to existing row objects.

A 、 CAST

B 、 REF

C 、 MULTISET

D 、 MAP

Answer: B

19. In Oracle, the following description of PL/SQL is correct.

A, PL/SQL stands for Power Language/SQL

B, PL/SQL do not support object-oriented programming

C, PL/SQL block includes declaration part, executable part and exception handling part.

The four built-in data types provided by D and PL/SQL are character,integer,float,boolean

Answer: C

In Oracle, read the following PL/SQL blocks:

DECLARE

V_lower NUMBER:=2

V_upper NUMBER:=100

V_count NUMBER:=1

BEGIN

I = 2; I SID NUMBER NOT NULL,Primary Key SNAME VARCHAR2 (30) COURSE_ID VARCHAR2 (10) NOT NULL MARKS NUMBER you need to query the students who have taken the course ID for C10 and whose scores are in the top 10, the following () statement can achieve this function.

A. SELECT SID,marks,ROWNUM "Rank"

FORM students

WHERE ROWNUM sal

10. Treat the hiredate column as the employee's birthday and ask for the employee who celebrates his birthday this month.

Answer:

Select * from emp where to_char (hiredate, 'mm') = to_char (sysdate,' mm')

11. Treat the hiredate column as the employee's birthday and ask for the employee's birthday next month.

Answer:

Select * from emp where to_char (hiredate, 'mm') = to_char (add_months (sysdate,1),' mm')

twelve。 Looking for employees who joined the staff in 1982

Answer:

Select * from emp where to_char (hiredate,'yyyy') = '1982'

13. Looking for employees to join in the second half of 1981

Answer:

Select * from emp where hiredate

Between to_date ('1981-7-1) and to_date (' 1982-1-1))

14. Calculate the number of employees who joined the workforce each month in 1981

Answer:

Select count (*), to_char (trunc (hiredate,'month'), 'yyyy-mm')

From emp where to_char (hiredate,'yyyy') = '1981'

Group by trunc (hiredate,'month')

Order by trunc (hiredate,'month')

15. Inquire about the average salary of each department

Answer:

Select deptno,avg (sal) from emp group by deptno

16. Show the minimum wage for various positions

Answer:

Select job,min (sal) from emp group by job

17. Arrange employee information from new to old according to the entry date

Answer:

Select * from emp order by hiredate desc

18. Inquire about the basic information of employees and append the names of their superiors

Answer:

Select e.times, e2.ename from emp e, emp e2 where e.mgr = e2.empno

19. Show the names and salaries of all employees whose salaries are higher than 'ALLEN'

Answer:

Select * from emp where sal > (select sal from emp where ename='ALLEN')

20. Displays details of employees who do the same job as' SCOTT'

Answer:

Select * from emp where job = (select * from emp where ename='SCOTT')

21. Display the names of employees in the sales department ('SALES')

Answer:

Select ename from emp e, dept d where e.deptno = d.deptno and d.dnameplate sales'

twenty-two。 Display the name and salary of the employee with the same salary as the 'MARTIN' employee in department 30

Answer:

Select ename, sal from emp

Where sal = (select sal from emp where deptno=30 and ename='MARTIN')

23. Query all sales staff whose salary is above average (including all employees) ('SALESMAN')

Answer:

Select * from emp where job='SALESMAN' and sal > (select avg (sal) from emp)

24. Show the names of all staff and the names of their departments and salaries

Answer:

Select ename, job, dname from emp e, dept d where e.deptno = d.deptno

25. Inquire about the number, name, work department and place of work of the staff working in the research and development department ('RESEARCH').

Answer:

Select empno,ename,dname,loc from emp e, dept d

Where e.deptno = d.deptno and danme='RESEARCH'

twenty-six。 Query the name of each department and the number of employees

Answer:

Select * from (select count (*) c, deptno from emp group by deptno) e

Inner join dept d on e.deptno = d.deptno

twenty-seven。 Query the number of employees in each position whose salary is higher than the average salary (the average salary includes all employees) and employee positions

Answer:

Select job, count (*) from emp where sal > (select avg (sal) from emp) group by job

twenty-eight。 Inquire about the salary and name of employees with the same salary

Answer:

Select * from emp e where (select count (*) from emp where sal = e.sal group by sal) > 1

twenty-nine。 Query the information of the three employees with the highest salary

Answer:

Select * from (select * from emp order by sal desc) where rownum e.sal) + 1 rank from emp e order byrank

thirty-one。 Looking for employees with the same entry date (the same year, month and day)

Answer:

Select * from emp e where (select count (*) from emp where e.hiredate=hiredate) > 1

thirty-two。 Inquire about the maximum wage of each department

Answer:

Select deptno, max (sal) maxsal from emp group by deptno order by deptno

thirty-three。 Inquire about the maximum wage of each department and each position

Answer:

Select deptno, job, max (sal) from emp group by deptno, job order by deptno, job

thirty-four。 Query the information and salary level of each employee

Answer:

Select e.girls, sg.grade from emp e, salgrade sg where sal between losal and hisal

thirty-five。 Inquire about the 6th to 10th employees with the highest salary

Answer:

Select * from (

Select e.paper.rownum rn from

(select * from emp order by sal desc) e

Where rownum 5

thirty-six。 Query the information of the highest-paid employees in each department

Answer:

Select * from emp e where e.sal = (select max (sal) from emp where (deptno = e.deptno))

thirty-seven。 Inquire about the top 2 employees with the highest salary in each department

Answer:

Select * from emp e where

(select count (*) from emp where sal > e.sal and e.deptno = deptno)

< 2 order by deptno, sal desc; 38. 查询出有3个以上下属的员工信息 答案: select * from emp e where (select count(*) from emp where e.empno = mgr) >

2

thirty-nine。 Query the information of all employees who are higher than the average salary of the department.

Answer:

Select * from emp e where sal >

(select avg (sal) from emp where (deptno = e.deptno))

Order by deptno

forty。 Inquire about the department with the highest average salary

Answer:

Select D. avgsal, avgsal from dept d, (select avg (sal) avgsal, deptno from emp group bydeptno) se

Where avgsal = (select max (avg (sal)) from emp group by deptno) and d.deptno = se.deptno

forty-one。 Query departmental information that is greater than the average total salary of each department

Answer:

Select d.awesome sumsal from dept d, (select sum (sal) sumsal, deptno from emp group bydeptno) se

Where sumsal > (select avg (sum (sal)) from emp group by deptno) and se.deptno = d.deptno

forty-two。 Query employee information under departments that are greater than the average total salary of each department

Answer:

Select e.immediate sumsal from emp e, (select sum (sal) sumsal, deptno from emp group bydeptno) se

Where sumsal > (select avg (sum (sal)) from emp group by deptno) and se.deptno = e.deptno

forty-three。 Query department information with no employees

Answer:

Select d.* from dept d left join emp e on (e.deptno = d.deptno) where empno is null

forty-four。 Query how many days there are in the current month

Answer:

Select trunc (add_months (sysdate,1), 'month')-trunc (sysdate,'month') from dual

forty-five。 List all kinds of jobs with a minimum wage greater than 1500 and the total number of employees engaged in this job

Answer:

SELECT job,COUNT (empno)

FROM emp

GROUP BY job HAVING MIN (sal) > 1500

forty-six。 List all employees whose salary is higher than the average salary of the company, their department, their superiors, and the salary grade of the company

Answer:

SELECT e.empno,e.ename,d.dname,m.ename,s.grade

FROM emp e,dept d,emp m,salgrade s

WHERE sal > (SELECT AVG (sal) FROM emp) AND e.mgr=m.empno AND d.deptno=e.deptno (+) AND e.sal BETWEEN s.losal AND s.hisal

forty-seven。 List the name of the employee whose salary is higher than that of all employees working in department 30 and the name of the department

Answer:

SELECT e.ename,e.sal,d.dname FROM emp e,dept d

WHERE sal > ALL (SELECT sal FROM emp WHERE deptno=30) AND e.deptno=d.deptno

forty-eight。 List the details and number of departments of all departments

Answer:

SELECT d.dname,d.loc,dt.count

FROM dept d, (SELECT deptno,COUNT (*) count FROM emp GROUP BY deptno) dt

WHERE d.deptno=dt.deptno

forty-nine。 Display the job name of the non-salesperson and the sum of the monthly salary of the employee engaged in the same job, and to satisfy that the total monthly salary of the employee engaged in the same job is more than $5000, and the output is arranged in ascending order of the total monthly salary.

Answer:

SELECT job,SUM (sal) sum

FROM emp

WHERE job'SALESMAN'

GROUP BY job HAVING sum > 5000

ORDER BY sum

fifty。 Customer form a (id name address) landing water meter b (id time) purchase logistics water meter c (id time productid productnum)

1. Ask for each customer's latest login time time, name name, customer id?

Answer:

Select a.id,a.name,d.time as time

From a left join (select id,max (time) as time from b group by id) d

On a.id = d.id

two。 Check the latest customers who have logged in and have purchased goods id,name, login time time (a sql statement)

Answer:

Select a.id,a.name,d.time as time

From a, (select id,max (time) as time from b group by id) d

Where a.id = d.id

And exists (select * from c where id = a.id)

About Me

.

● this article is sorted out from the network

● article is updated synchronously on itpub (http://blog.itpub.net/26736162), blog Park (http://www.cnblogs.com/lhrbest) and personal Wechat official account (xiaomaimiaolhr).

● article itpub address: http://blog.itpub.net/26736162/abstract/1/

● article blog park address: http://www.cnblogs.com/lhrbest

● pdf version of this article and wheat seedling cloud disk address: http://blog.itpub.net/26736162/viewspace-1624453/

● database written examination interview questions database and answers: http://blog.itpub.net/26736162/viewspace-2134706/

● QQ group: 230161599 WeChat group: private chat

● contact me, please add QQ friend (646634621), indicate the reason for adding

● completed in Mordor from 09:00 on 2017-07-01 to 22:00 on 2017-07-31.

The content of the ● article comes from the study notes of wheat seedlings, and some of it is sorted out from the Internet. Please forgive me if there is any infringement or improper place.

Copyright ● all rights reserved, welcome to share this article, please reserve the source for reprint

.

Pick up your phone and use Wechat client to scan the picture on the left below to follow the Wechat official account of wheat seedlings: xiaomaimiaolhr, scan the QR code on the right to join the QQ group of wheat seedlings, and learn the most practical database technology.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report