数据库基础

一、基础

MySQL数据库基础

二、索引

数据库索引

数据库索引是什么?新华字典来帮你

三、视图

MySQL数据库视图view

四、触发器

数据库学习笔记——21 使用触发器

五、例子

SQL语句

CREATE TABLE android_metadata (locale TEXT);

CREATE TABLE student(student_id integer primary key autoincrement, name varchar(20), age integer, gender bit, phone varchar(20));

CREATE TABLE score(score_id integer primary key autoincrement, name varchar(20), chinese real, math real, english real, average real);

CREATE INDEX student_name_index on student(name);

CREATE INDEX score_name_index on score(name);

CREATE VIEW student_info_view as select name, age, phone from student;

CREATE TRIGGER score_insert_trigger after insert on score for each row begin update score set average=(chinese + math + english)/3; end;

CREATE TRIGGER score_update_trigger after update on score for each row begin update score set average=(chinese + math + english)/3; end;

代码(使用AndroidStudio开发)

Student:

public class Student {
    private int student_id;
    private String name;
    private int age;
    private int gender;
    private String phone;

    public Student(String name, int age, int gender, String phone) {
        this.name = name;
        this.age = age;
        this.gender = gender;
        this.phone = phone;
    }

    public void setStudent_id(int student_id) {
        this.student_id = student_id;
    }

    public int getStudent_id() {
        return student_id;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public int getAge() {
        return age;
    }

    public void setGender(int gender) {
        this.gender = gender;
    }

    public int getGender() {
        return gender;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getPhone() {
        return phone;
    }

    @Override
    public String toString() {
        StringBuilder builder = new StringBuilder();
        builder.append("student_id: ")
                .append(student_id)
                .append(", name: ")
                .append(name)
                .append(", age: ")
                .append(age)
                .append(", gender: ")
                .append(gender)
                .append(", phone: ")
                .append(phone);
        return builder.toString();
    }
}

Score:

public class Score {
    private int score_id;
    private String name;
    private float chinese;
    private float math;
    private float english;
    private float average;

    public Score(String name, float chinese, float math, float english) {
        this.name = name;
        this.chinese = chinese;
        this.math = math;
        this.english = english;
    }

    public void setScore_id(int score_id) {
        this.score_id = score_id;
    }

    public int getScore_id() {
        return score_id;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public void setChinese(float chinese) {
        this.chinese = chinese;
    }

    public float getChinese() {
        return chinese;
    }

    public void setEnglish(float english) {
        this.english = english;
    }

    public float getEnglish() {
        return english;
    }

    public void setMath(float math) {
        this.math = math;
    }

    public float getMath() {
        return math;
    }

    public void setAverage(float average) {
        this.average = average;
    }

    public float getAverage() {
        return average;
    }

    @Override
    public String toString() {
        StringBuilder builder = new StringBuilder();
        builder.append("score_id: ")
                .append(score_id)
                .append(", name: ")
                .append(name)
                .append(", chinese: ")
                .append(chinese)
                .append(", math: ")
                .append(math)
                .append(", english: ")
                .append(english)
                .append(", average: ")
                .append(average);
        return builder.toString();
    }
}

MySQLiteOpenHelper:

public class MySQLiteOpenHelper extends SQLiteOpenHelper {
    private static final String TAG = "MySQLiteOpenHelper";
    //定义数据库文件名及版本号
    private static final String DB_NAME = "student.db";
    private static final int DB_VERSION = 3;

    private MySQLiteOpenHelper(Context context, String name, SQLiteDatabase.CursorFactory factory, int version) {
        super(context, name, factory, version);
    }

    //对外提供构造函数
    public MySQLiteOpenHelper(Context context) {
        //调用该类中的私有构造函数
        this(context, DB_NAME, null, DB_VERSION);
    }

    //当第一次创建数据库的时候回调方法
    @Override
    public void onCreate(SQLiteDatabase db) {
        Log.d(TAG, "zwm, onCreate");
        //创建数据库表的语句
        String sql = "create table student(student_id integer primary key autoincrement, name varchar(20), age integer, gender bit, phone varchar(20))";
        String sql2 = "create table score(score_id integer primary key autoincrement, name varchar(20), chinese real, math real, english real, average real)";
        db.execSQL(sql);
        db.execSQL(sql2);

        //创建数据库索引
        createDBIndex(db);

        //创建数据库视图
        createDBView(db);

        //创建数据库触发器
        createDBTrigger(db);
    }

    //当数据库升级的时候回调方法
    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
        Log.d(TAG, "zwm, onUpgrade, oldVersion: " + oldVersion + ", newVersion: " + newVersion);
        if(oldVersion < 3) {
            db.execSQL("alter table score add average real");

            //创建数据库触发器
            createDBTrigger(db);
        }
    }

    //当数据库被打开的时候回调方法
    @Override
    public void onOpen(SQLiteDatabase db) {
        Log.d(TAG, "zwm, onOpen");
    }

    //创建数据库索引
    private void createDBIndex(SQLiteDatabase db) {
        Log.d(TAG, "zwm, createDBIndex");
        db.execSQL("create index student_name_index on student(name)");
        db.execSQL("create index score_name_index on score(name)");
    }

    //创建数据库视图
    private void createDBView(SQLiteDatabase db) {
        Log.d(TAG, "zwm, createDBView");
        db.execSQL("create view student_info_view as select name, age, phone from student");
    }

    //创建数据库触发器
    private void createDBTrigger(SQLiteDatabase db) {
        Log.d(TAG, "zwm, createDBTrigger");
        db.execSQL("create trigger score_insert_trigger after insert on score for each row begin update score set average=(chinese + math + english)/3; end");
        db.execSQL("create trigger score_update_trigger after update on score for each row begin update score set average=(chinese + math + english)/3; end");
    }
}

DBManager:

public class DBManager {
    private static final String TAG = "DBManager";
    private volatile static DBManager sInstance;
    private MySQLiteOpenHelper mHelper;
    private SQLiteDatabase mDB;

    private DBManager(Context context) {
        mHelper = new MySQLiteOpenHelper(context);
        mDB = mHelper.getWritableDatabase();
    }

    public static DBManager getInstance(Context context) {
        if(sInstance == null) {
            synchronized (DBManager.class) {
                if(sInstance == null) {
                    sInstance = new DBManager(context);
                }
            }
        }
        Log.d(TAG, "zwm, getInstance: " + sInstance);
        return sInstance;
    }

    public void insetStudent(Student student) {
        Log.d(TAG, "zwm, insetStudent: " + student);
        if(mDB == null) {
            return;
        }
        mDB.execSQL("insert into student(name, age, gender, phone) values(?, ?, ?, ?)",
                new String[]{student.getName(), String.valueOf(student.getAge()), String.valueOf(student.getGender()), student.getPhone()});
    }

    public void deleteAllStudent() {
        Log.d(TAG, "zwm, deleteAllStudent");
        if(mDB == null) {
            return;
        }
        mDB.execSQL("delete from student");
    }

    public void deleteStudent(String name) {
        Log.d(TAG, "zwm, deleteStudent, name: " + name);
        if(mDB == null) {
            return;
        }
        mDB.execSQL("delete from student where name=?", new String[]{name});
    }

    public void updateStudent(Student student) {
        Log.d(TAG, "zwm, updateStudent: " + student);
        if(mDB == null) {
            return;
        }
        mDB.execSQL("update student set age=? , gender=?, phone=? where name=?",
                new String[]{String.valueOf(student.getAge()), String.valueOf(student.getGender()), student.getPhone(), student.getName()});
    }

    public List<Student> queryStudent() {
        Log.d(TAG, "zwm, queryStudent");
        if(mDB == null) {
            return null;
        }
        Cursor cursor = mDB.rawQuery("select * from student", null);
        List<Student> list = null;
        if (cursor.moveToFirst()) {
            list = new ArrayList<>();
            do {
                int student_id = cursor.getInt(cursor.getColumnIndex("student_id"));
                String name = cursor.getString(cursor.getColumnIndex("name"));
                int age = cursor.getInt(cursor.getColumnIndex("age"));
                int gender = cursor.getInt(cursor.getColumnIndex("gender"));
                String phone = cursor.getString(cursor.getColumnIndex("phone"));
                Student student = new Student(name, age, gender, phone);
                student.setStudent_id(student_id);
                list.add(student);
            } while (cursor.moveToNext());
        }
        return list;
    }

    public List<Student> queryStudent(String name) {
        Log.d(TAG, "zwm, queryStudent, name: " + name);
        if(mDB == null) {
            return null;
        }
        Cursor cursor = mDB.rawQuery("select * from student where name=?", new String[]{name});
        List<Student> list = null;
        if (cursor.moveToFirst()) {
            list = new ArrayList<>();
            do {
                int student_id = cursor.getInt(cursor.getColumnIndex("student_id"));
                int age = cursor.getInt(cursor.getColumnIndex("age"));
                int gender = cursor.getInt(cursor.getColumnIndex("gender"));
                String phone = cursor.getString(cursor.getColumnIndex("phone"));
                Student student = new Student(name, age, gender, phone);
                student.setStudent_id(student_id);
                list.add(student);
            } while (cursor.moveToNext());
        }
        return list;
    }

    public void insetScore(Score score) {
        Log.d(TAG, "zwm, insetScore: " + score);
        if(mDB == null) {
            return;
        }
        mDB.execSQL("insert into score(name, chinese, math, english) values(?, ?, ?, ?)",
                new String[]{score.getName(), String.valueOf(score.getChinese()), String.valueOf(score.getMath()), String.valueOf(score.getEnglish())});
    }

    public void deleteAllScore() {
        Log.d(TAG, "zwm, deleteAllScore");
        if(mDB == null) {
            return;
        }
        mDB.execSQL("delete from score");
    }

    public void deleteScore(String name) {
        Log.d(TAG, "zwm, deleteScore, name: " + name);
        if(mDB == null) {
            return;
        }
        mDB.execSQL("delete from score where name=?", new String[]{name});
    }

    public void updateScore(Score score) {
        Log.d(TAG, "zwm, updateScore: " + score);
        if(mDB == null) {
            return;
        }
        mDB.execSQL("update score set chinese=? , math=?, english=? where name=?",
                new String[]{String.valueOf(score.getChinese()), String.valueOf(score.getMath()), String.valueOf(score.getEnglish()), score.getName()});
    }

    public List<Score> queryScore() {
        Log.d(TAG, "zwm, queryScore");
        if(mDB == null) {
            return null;
        }
        Cursor cursor = mDB.rawQuery("select * from score", null);
        List<Score> list = null;
        if (cursor.moveToFirst()) {
            list = new ArrayList<>();
            do {
                int score_id = cursor.getInt(cursor.getColumnIndex("score_id"));
                String name = cursor.getString(cursor.getColumnIndex("name"));
                float chinese = cursor.getFloat(cursor.getColumnIndex("chinese"));
                float math = cursor.getFloat(cursor.getColumnIndex("math"));
                float english = cursor.getFloat(cursor.getColumnIndex("english"));
                float average = cursor.getFloat(cursor.getColumnIndex("average"));
                Score score = new Score(name, chinese, math, english);
                score.setScore_id(score_id);
                score.setAverage(average);
                list.add(score);
            } while (cursor.moveToNext());
        }
        return list;
    }

    public List<Score> queryScore(String name) {
        Log.d(TAG, "zwm, queryScore, name: " + name);
        if(mDB == null) {
            return null;
        }
        Cursor cursor = mDB.rawQuery("select * from score where name=?", new String[]{name});
        List<Score> list = null;
        if (cursor.moveToFirst()) {
            list = new ArrayList<>();
            do {
                int score_id = cursor.getInt(cursor.getColumnIndex("score_id"));
                float chinese = cursor.getFloat(cursor.getColumnIndex("chinese"));
                float math = cursor.getFloat(cursor.getColumnIndex("math"));
                float english = cursor.getFloat(cursor.getColumnIndex("english"));
                float average = cursor.getFloat(cursor.getColumnIndex("average"));
                Score score = new Score(name, chinese, math, english);
                score.setScore_id(score_id);
                score.setAverage(average);
                list.add(score);
            } while (cursor.moveToNext());
        }
        return list;
    }

    public Cursor queryStudentInfoView() {
        if(mDB == null) {
            return null;
        }
        Cursor cursor = mDB.rawQuery("select * from student_info_view", null);
        return cursor;
    }

    public void closeDB() {
        Log.d(TAG, "zwm, closeDB");
        if(mDB != null) {
            mDB.close();
            sInstance = null;
        }
    }
}

MainActivity:

public class MainActivity extends Activity {
    private static final String TAG = "MainActivity";
    private DBManager dbManager;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        dbManager = DBManager.getInstance(getApplicationContext());
        //student数据表测试
        Student xiaoming = new Student("xiaoming", 29, 1, "15017538888");
        Student xiaohuan = new Student("xiaohuan", 26, 0, "13751868888");
        Student xiaohan = new Student("xiaohan", 2, 0, "16899998888");
        dbManager.insetStudent(xiaoming);
        dbManager.insetStudent(xiaohuan);
        dbManager.insetStudent(xiaohan);

        List<Student> list = dbManager.queryStudent();
        for(Student student : list) {
            Log.d(TAG, "zwm, student: " + student);
        }
        List<Student> list2 = dbManager.queryStudent("xiaohan");
        for(Student student : list2) {
            Log.d(TAG, "zwm, student: " + student);
        }

        dbManager.deleteStudent("xiaoming");
        xiaohan.setAge(3);
        dbManager.updateStudent(xiaohan);

        list = dbManager.queryStudent();
        for(Student student : list) {
            Log.d(TAG, "zwm, student: " + student);
        }

        //score数据表测试
        Score xiaomingScore = new Score("xiaoming", 88, 100, 99);
        Score xiaohuanScore = new Score("xiaohuan", 90, 98, 96);
        Score xiaohanScore = new Score("xiaohan", 100, 100, 98);
        dbManager.insetScore(xiaomingScore);
        dbManager.insetScore(xiaohuanScore);
        dbManager.insetScore(xiaohanScore);

        List<Score> listScore = dbManager.queryScore();
        for(Score score : listScore) {
            Log.d(TAG, "zwm, score: " + score);
        }
        List<Score> listScore2 = dbManager.queryScore("xiaohan");
        for(Score score : listScore2) {
            Log.d(TAG, "zwm, score: " + score);
        }

        dbManager.deleteScore("xiaoming");
        xiaohanScore.setEnglish(100);
        dbManager.updateScore(xiaohanScore);

        listScore = dbManager.queryScore();
        for(Score score : listScore) {
            Log.d(TAG, "zwm, score: " + score);
        }

        //student_info_view数据视图测试
        Cursor cursor = dbManager.queryStudentInfoView();
        Log.d(TAG, "zwm, query student_info_view");
        if (cursor.moveToFirst()) {
            do {
                String name = cursor.getString(cursor.getColumnIndex("name"));
                int age = cursor.getInt(cursor.getColumnIndex("age"));
                String phone = cursor.getString(cursor.getColumnIndex("phone"));
                Log.d(TAG, "zwm, name: " + name + ", age: " + age + ", phone: " + phone);
            } while (cursor.moveToNext());
        }
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();

        if(dbManager != null) {
            dbManager.deleteAllStudent();
            dbManager.deleteAllScore();
            dbManager.closeDB();
        }
    }
}

输出Log:

2019-03-07 16:56:49.824 D/MySQLiteOpenHelper: zwm, onCreate
2019-03-07 16:56:49.826 D/MySQLiteOpenHelper: zwm, createDBIndex
2019-03-07 16:56:49.827 D/MySQLiteOpenHelper: zwm, createDBView
2019-03-07 16:56:49.827 D/MySQLiteOpenHelper: zwm, createDBTrigger
2019-03-07 16:56:49.835 D/MySQLiteOpenHelper: zwm, onOpen
2019-03-07 16:56:49.835 D/DBManager: zwm, getInstance: com.tomorrow.test2019_2.DBManager@22e0b50
2019-03-07 16:56:49.836 D/DBManager: zwm, insetStudent: student_id: 0, name: xiaoming, age: 29, gender: 1, phone: 15017538888
2019-03-07 16:56:49.841 D/DBManager: zwm, insetStudent: student_id: 0, name: xiaohuan, age: 26, gender: 0, phone: 13751868888
2019-03-07 16:56:49.847 D/DBManager: zwm, insetStudent: student_id: 0, name: xiaohan, age: 2, gender: 0, phone: 16899998888
2019-03-07 16:56:49.853 D/DBManager: zwm, queryStudent
2019-03-07 16:56:49.855 D/MainActivity: zwm, student: student_id: 1, name: xiaoming, age: 29, gender: 1, phone: 15017538888
2019-03-07 16:56:49.855 D/MainActivity: zwm, student: student_id: 2, name: xiaohuan, age: 26, gender: 0, phone: 13751868888
2019-03-07 16:56:49.856 D/MainActivity: zwm, student: student_id: 3, name: xiaohan, age: 2, gender: 0, phone: 16899998888
2019-03-07 16:56:49.856 D/DBManager: zwm, queryStudent, name: xiaohan
2019-03-07 16:56:49.857 D/MainActivity: zwm, student: student_id: 3, name: xiaohan, age: 2, gender: 0, phone: 16899998888
2019-03-07 16:56:49.857 D/DBManager: zwm, deleteStudent, name: xiaoming
2019-03-07 16:56:49.864 D/DBManager: zwm, updateStudent: student_id: 0, name: xiaohan, age: 3, gender: 0, phone: 16899998888
2019-03-07 16:56:49.866 D/DBManager: zwm, queryStudent
2019-03-07 16:56:49.867 D/MainActivity: zwm, student: student_id: 2, name: xiaohuan, age: 26, gender: 0, phone: 13751868888
2019-03-07 16:56:49.867 D/MainActivity: zwm, student: student_id: 3, name: xiaohan, age: 3, gender: 0, phone: 16899998888
2019-03-07 16:56:49.868 D/DBManager: zwm, insetScore: score_id: 0, name: xiaoming, chinese: 88.0, math: 100.0, english: 99.0, average: 0.0
2019-03-07 16:56:49.874 D/DBManager: zwm, insetScore: score_id: 0, name: xiaohuan, chinese: 90.0, math: 98.0, english: 96.0, average: 0.0
2019-03-07 16:56:49.881 D/DBManager: zwm, insetScore: score_id: 0, name: xiaohan, chinese: 100.0, math: 100.0, english: 98.0, average: 0.0
2019-03-07 16:56:49.902 D/DBManager: zwm, queryScore
2019-03-07 16:56:49.906 D/MainActivity: zwm, score: score_id: 1, name: xiaoming, chinese: 88.0, math: 100.0, english: 99.0, average: 95.666664
2019-03-07 16:56:49.907 D/MainActivity: zwm, score: score_id: 2, name: xiaohuan, chinese: 90.0, math: 98.0, english: 96.0, average: 94.666664
2019-03-07 16:56:49.907 D/MainActivity: zwm, score: score_id: 3, name: xiaohan, chinese: 100.0, math: 100.0, english: 98.0, average: 99.333336
2019-03-07 16:56:49.907 D/DBManager: zwm, queryScore, name: xiaohan
2019-03-07 16:56:49.910 D/MainActivity: zwm, score: score_id: 3, name: xiaohan, chinese: 100.0, math: 100.0, english: 98.0, average: 99.333336
2019-03-07 16:56:49.910 D/DBManager: zwm, deleteScore, name: xiaoming
2019-03-07 16:56:49.922 D/DBManager: zwm, updateScore: score_id: 0, name: xiaohan, chinese: 100.0, math: 100.0, english: 100.0, average: 0.0
2019-03-07 16:56:49.925 D/DBManager: zwm, queryScore
2019-03-07 16:56:49.926 D/MainActivity: zwm, score: score_id: 2, name: xiaohuan, chinese: 90.0, math: 98.0, english: 96.0, average: 94.666664
2019-03-07 16:56:49.926 D/MainActivity: zwm, score: score_id: 3, name: xiaohan, chinese: 100.0, math: 100.0, english: 100.0, average: 100.0
2019-03-07 16:56:49.927 D/MainActivity: zwm, query student_info_view
2019-03-07 16:56:49.927 D/MainActivity: zwm, name: xiaohuan, age: 26, phone: 13751868888
2019-03-07 16:56:49.928 D/MainActivity: zwm, name: xiaohan, age: 3, phone: 16899998888
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 214,588评论 6 496
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 91,456评论 3 389
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 160,146评论 0 350
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 57,387评论 1 288
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 66,481评论 6 386
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 50,510评论 1 293
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 39,522评论 3 414
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 38,296评论 0 270
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 44,745评论 1 307
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 37,039评论 2 330
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 39,202评论 1 343
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 34,901评论 5 338
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 40,538评论 3 322
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 31,165评论 0 21
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 32,415评论 1 268
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 47,081评论 2 365
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 44,085评论 2 352

推荐阅读更多精彩内容

  • MYSQL 基础知识 1 MySQL数据库概要 2 简单MySQL环境 3 数据的存储和获取 4 MySQL基本操...
    Kingtester阅读 7,797评论 5 116
  • 一、环境搭建 1、安装软件 安装oracle_client 安装plsql 2、配置数据库连接信息 新建文件:C:...
    果芽软件阅读 846评论 0 8
  • 一、基础操作--sql语句 启动MySQL:service mysql start停止MySQL:service ...
    心石卒了丶无痕阅读 2,266评论 0 0
  • 一、数据库简介 简单说存放数据的仓库,这个仓库按照一定的数据结构<数据结构是指数据的组织形式或数据之间的联系>来组...
    王梓懿_1fbc阅读 872评论 0 0
  • 约翰是个大学的数学教授,绝对的聪明人,能在任何智力测验上取得很高的分数,然而他却做了一连串非常愚蠢的事。 ...
    李大侠ID阅读 320评论 0 0