《oracle-web考试题(oracle-web考试题).pdf》由会员分享,可在线阅读,更多相关《oracle-web考试题(oracle-web考试题).pdf(22页珍藏版)》请在taowenge.com淘文阁网|工程机械CAD图纸|机械工程制图|CAD装配图下载|SolidWorks_CaTia_CAD_UG_PROE_设计图分享下载上搜索。
1、oracle-web 考试题(oracle-web 考试题)Oracle:1.query wages are higher than 7000 of all employees but nocommission.Select*from employees where salary7000 and commission pctis null2.query all last_name by four or more letters of employeeinformationSelect*from employees where last_name like,%3.query No.50 grow
2、th after 1000 yuan each department staffwages name and salary.Select first_name,last_name(salary+1000)salary fromemployees where department_id=50The full name of the 4.employees of the email query,emailunified end in”.Select(emaiF email from employees|)5.Commission(COMM)for the 0 query or NULL emplo
3、yeeinformationSelect*from employees where commission_pct=0 orcommission_pct is null6.shows in the company all staff salary level case when=5000 A 5000-8000 B 8000-15000 C 15000 DSelect first_name,case when salary5000 and salary8000 and salary0611.1981 has a number of years for each monthly post staf
4、f(StudyGroup:knowledge function)Select count(*)“entry number”,to_char(hire_date,mm)“month from employeesWhere to_char(hire date,(yyyy)=198T group by hire date12.query No.50 departments,60 departments,70 Departmentsof the average wageSelect A V G (salary)average wage z/department_id departmentnumber
5、from employeesWhere departmentid in(50,60,70)group by departmentid13.query the total number of employees in each postSelect count(*)“number of employees”,job id from employeesgroup by job id post14.of the average wage query is higher than the highest wageof 8000 yuan in the DepartmentSelect max(max)
6、“highest wage”F r o m (s e l e c t m a x (s a l a r y)m a x,d e p a r t m e ntd f r o m e m p l o y e e sg r o u p b y d e p a r t m e nt i d h a v i ng A V G(s a l a r y)8 0 0 0)15.s t a t i s t i c s t h e nu m b e r o f m a na g e r s i n t h e c o m p a nyS e l e c t c o u nt (d i s t i nc t m a
7、 na g e r i d)f r o m e m p l o y e e s16.p r i nt a l l t h e na m e s o f e m p l o y e e s,w a g e s,t h e na m e o f t h ee nt r y t i m e a nd d e p a r t m e ntS e l e c t f i r s t _ na m e l a s t _ na m e I II I na m e,s a l a r y,h i r e _ d a t e,d e p a r t m e nt _ i d f r o m e m p l o
8、 y e e s17.p r i nt o u t t h e c o m p a ny r a nk e d t h e h i g h e s t w a g e s t o t e nt he m p l o y e e s i n f i f t h i nf o r m a t i o nS e l e c t *f r o m(s e l e c t e.*,r o w nu m r f r o mt o _ c h a r (e m p l o y e e _ i d)的“价值从员工那里 e m p l o y e e _ i d =10 0联盟选 择f i r s t _ na
9、 m e 标题”,t o c h a r (f i r s t na m e)的“价值”从员工那里 e m p l o y e e i d =10 0联盟选 择“工资”的“头衔”,t o _ c h a r (工资)的“价值”从员工工资=2 40 0 0联盟选择 ud e p a r t m e nt _ i d 标 题,t o _ c h a r (d e p a r t m e nt _ i d)的“价值”从员工那里e m p l o y e e _ i d =10 02 9 建表语句中约束的有哪几种类型1)主键主键约束,非空并且唯一,一张表只能有一个主键2)不为空非空约束,插入时这一列必
10、须给值3)独特的:唯一性约束,要求这一列值必须唯一,对空没有限制,可以出现多个空值4)c h e c k():自定义约束5)外键:外键约束,使用关键字参考表名(P K),外键必须指向另一个表的主键或者唯一键,外键的值必须在父表的主键里取,外间的值可以重复,可以为空3 0 o表一级约束和列一级约束的区别约束分为列一级约束和表一级约束,通常可以互换,但是在以下两种特殊情况下不能互换1.no t空只能定义在列一级2 o联合键只能定义在表一级3 10写出D M L命令D M L (数据操作语言):插入、更新和删除3 2O事务的四大特性1,(原子):原子性,事务包涵的命令不可再分20 C (一致性):一
11、致性,事务开始和结束时数据状态保持一致3 o 我(隔离):隔离性,并发运行的多个事务之间,互不影响4。D (耐久性):持久性,事务结束时一定要做持久化操作(永久保存犯,永久丢弃回滚)3 3 o 关联关系(一对一,一对多,多对多)在数据库中的表示方法1)一对一:学生电脑F K +英国P K +F K (共享主键):双方联系紧密时选择建立学生表(编 号(6)主键,名字空不空(15),C ID 编 号(6)引用计算机(i d)唯一)创建表的计算机(编号(6)主键,(1 5)非空型空)2)一对多:员工部门在多的一方建外键建立学生表(编号(6)主键,名字空不空(15),CID编 号(6)参考计算机(ID
12、)创建表的类(编号(6)主键,名字空不空(15)3)多对多:学生课程无法直接表示,通过增加一个关系实体的方式,将多对多拆成两个一对多处理建立学生表(编 号(6)主键,名字空不空(15),)仓i j建表 re la ti onta b le(S I D编 号(6)引用学生(I D),C I D编 号(6)参 考 课 程(I D),主 键(S I D,C I D)课程表(编 号(6)主键,名字空不空(15)34。事务的隔离级别有几种,W hat are they?Read before submission of 1.read-uncommited:Read after submission of
13、 2.read-commited:3.repeatable-read:repeat(additional lock)4.serializable:(tagged serialize access lock)Jdbc:1.write a JDBC based code,print out the data in the shop usertable in the database.P ackage dayl;Import java.sql.Import util.JdbcUtill;P ublic class SelectSample(P ublic static void main(Strin
14、g口 args)Connection conn=null;Statement stm=nul1;ResultSet rs=null;Try Conn=JdbcUtill.getConnection();Stm=conn.createStatement();String sql=select username,password,name,zip,address fromshop_user where username=,luxw;Rs=stm.executeQuery(SQL);If(rs.next()/while(rs.next()String username=rs.getString(1)
15、;String password=rs.getString(2);String name=rs.getString(3);Int zip=rs.getlnt(4);String addressers.getString(5);System,out.printin(username+password+-+name+-+zip+-+address);catch(Exception E)E.printStackTrace();finallyJdbcUtill.close(RS,STM,Conn);)2.briefly describe the working principle of P repar
16、edStatementP reparedStatement:is the sub interface of StatementDifference:1.creation time(stm=conn.createStatement)do not need to create the SQLstatement;P stm=conn.prepareStatment(SQL);to create a given SQLstatement(you can use SQL?)2.execution timeStm.execute(SQL);the execution of a given SQL,serv
17、er to sendthe full SQL commandPstm.execute(SQL);executes the given SQL at the time ofexecution,and sends a set of values every time the executionis executed3.use environment:The execution is isomorphic to SQL,PreparedStatement highefficiencyIs the implementation of the heterogeneous SQL,Statement hi
18、ghefficiencyWhich when the SQL command needs external parameters when usingPSTMWhat are the implementation methods of 3.Statement(4),thereturn value of meaning1.Boolean execute(SQL)select Insert update delete IA value of Boolean indicates the execution of the SQL commandis a result set to the true:f
19、alse:If the return value is true,Result(rs=stm.getResultSet);2.ResultSet executeQuery(SQL)/select3.int executeUpdate I insert update delete(SQL)The int value indicates that the command execution,affectinga few lines data table4.pointer result set respectively in what position at the startand end of
20、the timeThe pointer starts at the upper line of the first row and endsat the next line of the last line.No matter how many rows inthe result set,the data must be called before traversingOnce next()5.jdbc the default transaction commit strategy?What are the3 methods need to manually control the trans
21、action?Treatment of JDBC in the default transaction is a command fora transaction and a commitApi:for manual transaction controlConn.setAutoCommit(false);I will automatically submitstrategies close transactions,instead of manual submissionConn,commit(I);commitConn.rollback(rollback);bal1;6.briefly d
22、escribe the role of ThreadLocalBind threads to connections7.write to get a scroll,The code for non updatable ResultSetStm=conn.createStatement(int VI,int V2);Pstm=conn.prepareStatement(SQL,VI,V2);VI:rolling ResultSet.TYPE_SCROLL_INSENSITIVEV2:update ResultSet.CONCUR_UPDATABLEResultSet.CONCUR_READ_ON
23、LY8.using JDBC to achieve large data copies of the table,whatskills can improve the efficiency of the implementation of theprogram,at least enumerate 41.control the size of the transaction2.using prepareStatement3.batch update Batch4.isolation level appropriate reduction5.control new table constrain
24、ts9.take Employee and Department as examples,define two Javaclasses,and describe how to define the two-way one to manyrelationships between the twoPublic class EmployeeP rivate-P rivate Department dep;)P ublic class DepartmentP rivate-P rivate List list=new(A rrayList);)10.write the code,the complet
25、e description,from thedefinition of data to the whole process of data storage(Java,SQL,Dao),assume that the two are betweenOne way,one to many relationships from order to userOne to many:ShopUser-ShopOrderThe 1.java:of a party to keep a collection of a quote from aparty to keep a muchClass ShopUser(
26、P rivate String username;private String password;privateString name;Private int zip;private String address;/private List orders=new(ArrayList);Class ShopOrderPrivate Integer id;Private Date orderTime;Private double totalPrice;Private ShopUser user;)2.db table:creates a foreign key on multiple sidesC
27、reate table shop_user(username VARCHAR2(15)primary key,);Create table shop_order(ID number(7)primary key,Ordertime date,Totalprice number(7,2),Username VARCHAR2(15)references shop user(username);3.dao(ShopUserDao,ShopOrderDao)Class ShopUserDao(insert udpate queryClass ShopOrderDaoPublic void insert(
28、ShopOrder order)throws Exception;Public ShopOrder queryByld(Integer ID)throws Exception;Public List queryByllsername(String username)throws Exception;HTML,CSS,JavaScript3 methods 1.in HTML embedded CSS code,a detailed code1).The introduction of CSS file 2).-in head3).Embedded in the tag style=colour
29、ed;-“2.defines a hyperlink tag that requires the LoginV iew.htmlfile to be opened under the myservlet application in the newwindow after clicking-3.define a HTML file,In the middle of the window shows a picture of 200*200,a pictureof a red border4.javascript defines a summation function that can com
30、pute thesum and return of two parameters a,B,and give 3 definitions1).Function add(a,b)return a+b;2).V ar add=function(a,b)a+b;3).V ar add=new Function(a,B,return a+b);W hat is the difference between the 5.of the following fourmethods to output clientDocument,write(HelloWorld);alert(helloWorld);Prom
31、pt(HelloWorld);confirm(HelloWorld);6.the definition of a user registration page,and complete theclient form data corresponding verification.Username:length must be=7 bitPassword:two input password must be consistent,otherwise notsubmittedEmail:valid emai1 must contain Address:it includes provinces,c
32、ities,streets.Province andcity made a drop-down list associated with the selecteddrop-down list will appear after the cityThe corresponding city of the province.The street is a generaltext box7.define a class information page,display the specificinformation of the students in the form of the form,we
33、b pageallows dynamic addition of new students,Al lowed to delete a student,allowing students to bulk delete.Student information contains the following contents:StudentID studentName phone email QQWeb:1.custom servlet,realize the difference between the Servletinterface and the HttpServlet class inher
34、itance?2.write out 3 ways of life cycle of Servlet3.what scope is named attribute preservation can span more thanone request.4.to distinguish between the four fields,write their owncharacteristics5.assume that the myservlet application has a program withurl-pattern/abc,write write request forwarding
35、(forward)andThe code that redirects to the program6.what is the ServletContext object,write several methods ofthe object7.assume a train ticket total number of 200,write a servletprogram to provide ticketing services,while clientPrint the seat number,request the procedure is thread safe.What are the
36、 two ways to send 8.http requests?9.briefly describes the implementation principle of sessionWhat,s the difference between 10.servlet and session in JSP?11.connection pool action12.write specific code to get links from a connection pool.13.define and configure a filter/abc application request andres
37、ponse encoding is adjusted to UTF-8.When running 14.HttpSessionListener program.How to configurethe listener in the web.xml file.15.write out all the hidden objects in JSPmon variables and expressions defined in script scriptdefines what is the difference between the variables17.assume the following
38、 Java class,declare an object definingthe class in the JSP page,assign the attribute to it,And access its attributes through El expressionsPackage entity;Class Student private Integer ID;private String name;privateint age;18.write the following El expression:1)print session,s ID 2)to determine wheth
39、er the parameter nameis empty 3)access the name property in the session scope4)access the value corresponding to the name primary key inmap19.with the formal definition of the variable URI label,valuesfor the following string,where myservlet is the name of theapplication/myservlet/abc/bcd?Name=zhang
40、san&age=1620.in the JSP page in how to set up the response content typeand encoding method21.print 99 multiplication tables with JSTLpletion of student achievement management system queryand add functionality,the use of the entity for Student1)类学生 私人整数ID;私人字符串名称;私人双重评分;2)数据库建表(3)studentdao完成查询和添加功能)4)首页显示所有的学生信息、,添加新建学生的功能。