2012/12/19 23:08 by 灵月 (ps:高手请路过,新手可一笑而过 ) 授课老师:林嵩 教授内容: SQL基础 1.了解什么是SQL语句 2.了解SQL语句关于表的操作 3.掌握SQL语句的查询命令 4.掌握SQL常用函数 5.掌握SQL语句对于数据表中记录的操作 6.了解数据库的其它对象
2012/12/19 23:08 by 灵月
(ps:高手请路过,新手可一笑而过)
授课老师:林嵩
教授内容:
SQL基础
1.了解什么是SQL语句
2.了解SQL语句关于表的操作
3.掌握SQL语句的查询命令
4.掌握SQL常用函数
5.掌握SQL语句对于数据表中记录的操作
6.了解数据库的其它对象:视图、序列、索引,同义词
7.解数据库权限分配
个人学习情况:
今天真是够快的,这对于我这个刚接触oracle的菜鸟够呛!
记下几个课堂中自己不懂的知识点:
1.字符型日期插入’25-12月-01‘;
2.number(8,2) 123456.12 整数位只有6位;
3.char 与 varchar2的区别 这个从二方面理解,定长肯定是占资源,解析快,不定长 是占资源少,解析慢,各有千秋;
4.几个约束键:check 、default、unique;
5.to_char();
6.取消重复行 distinct
7.通配符 % _
8.escape / 转义符
9.连接查询 (这个内容多)
学习 步步为营 博文一篇 http://blog.163.com/yuxiangtong0524@126/blog/static/8008616320103624845309/
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
ORACLE左右连接
2010-04-06 14:48:45| 分类: Oracle |字号大中小 订阅
1.
左连接
a.a=b.b(+)
右连接
a.a(+)=b.b
2.
create table dali.test1(a int,b int);
create table dali.test2(a int,b int);
insert into dali.test1 values(1,456);
insert into dali.test1 values(2,427);
insert into dali.test2 values(1,45456);
insert into dali.test2 values(3,45656);
---内连接
select * from dali.test1 a, dali.test2 b where a.a=b.a;
---左连接
select * from dali.test1 a, dali.test2 b where a.a=b.a(+);
---右连接
select * from dali.test1 a, dali.test2 b where a.a(+)=b.a;
---完全连接
select * from dali.test1 a, dali.test2 b where a.a=b.a(+)
union
select * from dali.test1 a, dali.test2 b where a.a(+)=b.a;
---迪卡尔
select * from dali.test1, dali.test2;
3.数据表的连接有:
1、内连接(自然连接): 只有两个表相匹配的行才能在结果集中出现
2、外连接: 包括
(1)左外连接(左边的表不加限制)
(2)右外连接(右边的表不加限制)
(3)全外连接(左右两表都不加限制)
3、自连接(连接发生在一张基表内)
select a.studentno, a.studentname, b.classname
from students a, classes b
where a.classid(+) = b.classid;
STUDENTNO STUDENTNAM CLASSNAME
---------- ---------- ------------------------------
1 周虎 一年级一班
2 周林 一年级二班
3 一年级三班
以上语句是右连接:
即"(+)"所在位置的另一侧为连接的方向,右连接说明等号右侧的所有
记录均会被显示,无论其在左侧是否得到匹配。也就是说上例中,无
论会不会出现某个班级没有一个学生的情况,这个班级的名字都会在
查询结构中出现。
反之:
select a.studentno, a.studentname, b.classname
from students a, classes b
where a.classid = b.classid(+);
STUDENTNO STUDENTNAM CLASSNAME
---------- ---------- ------------------------------
1 周虎 一年级一班
2 周林 一年级二班
3 钟林达
则是左连接,无论这个学生有没有一个能在一个班级中得到匹配的部门号,
这个学生的记录都会被显示。
select a.studentno, a.studentname, b.classname
from students a, classes b
where a.classid = b.classid;
这个则是通常用到的内连接,显示两表都符合条件的记录
总之,
左连接显示左边全部的和右边与左边相同的
右连接显示右边全部的和左边与右边相同的
内连接是只显示满足条件的! ......
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
10.学习视图时遇到个小问题,关于scott无权限建立view视图的,百度解决引 piranha博文一篇 http://piranha.iteye.com/blog/847877
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
在创建用户的时候如果直接给用户DBA权限,那么在B用户中可以直接查询A用户的表,但是在创建视图时就会报无权限,在这种情况下需要再在被访问的A用户里面去给予要访问该表的B用户授权。
--创建视图权限,一般网上找都是说的这句,但是光有这句还是无法创建
grant create view to B;
--授予查询权限
grant select any table to B;
--授予权限
grant select any dictionary to B;
以上3项地后就能正常创建视图了。
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
时间比较晚,赶紧收拾下睡觉!

InnoDBBufferPool reduces disk I/O by caching data and indexing pages, improving database performance. Its working principle includes: 1. Data reading: Read data from BufferPool; 2. Data writing: After modifying the data, write to BufferPool and refresh it to disk regularly; 3. Cache management: Use the LRU algorithm to manage cache pages; 4. Reading mechanism: Load adjacent data pages in advance. By sizing the BufferPool and using multiple instances, database performance can be optimized.

Compared with other programming languages, MySQL is mainly used to store and manage data, while other languages such as Python, Java, and C are used for logical processing and application development. MySQL is known for its high performance, scalability and cross-platform support, suitable for data management needs, while other languages have advantages in their respective fields such as data analytics, enterprise applications, and system programming.

MySQL is worth learning because it is a powerful open source database management system suitable for data storage, management and analysis. 1) MySQL is a relational database that uses SQL to operate data and is suitable for structured data management. 2) The SQL language is the key to interacting with MySQL and supports CRUD operations. 3) The working principle of MySQL includes client/server architecture, storage engine and query optimizer. 4) Basic usage includes creating databases and tables, and advanced usage involves joining tables using JOIN. 5) Common errors include syntax errors and permission issues, and debugging skills include checking syntax and using EXPLAIN commands. 6) Performance optimization involves the use of indexes, optimization of SQL statements and regular maintenance of databases.

MySQL is suitable for beginners to learn database skills. 1. Install MySQL server and client tools. 2. Understand basic SQL queries, such as SELECT. 3. Master data operations: create tables, insert, update, and delete data. 4. Learn advanced skills: subquery and window functions. 5. Debugging and optimization: Check syntax, use indexes, avoid SELECT*, and use LIMIT.

MySQL efficiently manages structured data through table structure and SQL query, and implements inter-table relationships through foreign keys. 1. Define the data format and type when creating a table. 2. Use foreign keys to establish relationships between tables. 3. Improve performance through indexing and query optimization. 4. Regularly backup and monitor databases to ensure data security and performance optimization.

MySQL is an open source relational database management system that is widely used in Web development. Its key features include: 1. Supports multiple storage engines, such as InnoDB and MyISAM, suitable for different scenarios; 2. Provides master-slave replication functions to facilitate load balancing and data backup; 3. Improve query efficiency through query optimization and index use.

SQL is used to interact with MySQL database to realize data addition, deletion, modification, inspection and database design. 1) SQL performs data operations through SELECT, INSERT, UPDATE, DELETE statements; 2) Use CREATE, ALTER, DROP statements for database design and management; 3) Complex queries and data analysis are implemented through SQL to improve business decision-making efficiency.

The basic operations of MySQL include creating databases, tables, and using SQL to perform CRUD operations on data. 1. Create a database: CREATEDATABASEmy_first_db; 2. Create a table: CREATETABLEbooks(idINTAUTO_INCREMENTPRIMARYKEY, titleVARCHAR(100)NOTNULL, authorVARCHAR(100)NOTNULL, published_yearINT); 3. Insert data: INSERTINTObooks(title, author, published_year)VA


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

Dreamweaver Mac version
Visual web development tools

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software