电话号码数据库,数据库中电话号码的字段名是什么
大家好,电话号码数据库相信很多的网友都不是很明白,包括数据库中电话号码的字段名是什么也是一样,不过没有关系,接下来就来为大家分享关于电话号码数据库和数据库中电话号码的字段名是什么的一些知识点,大家可以关注收藏,免得下次来找不到哦,下面我们开始吧!
如何设计哈希表实现电话号码查询系统
//#include"iostream.h"
#include<iostream>
#include"string.h"
#include"fstream"
#define NULL 0
unsigned int key;
unsigned int key2;
int*p;
struct node//建节点
{
char name[8],address[20];
char num[11];
node* next;
};
typedef node* pnode;
typedef node* mingzi;
node**phone;
node**nam;
node*a;
using namespace std;//使用名称空间
void hash(char num[11])//哈希函数
{
int i= 3;
key=(int)num[2];
while(num[i]!=NULL)
{
key+=(int)num[i];
i++;
}
key=key%20;
}
void hash2(char name[8])//哈希函数
{
int i= 1;
key2=(int)name[0];
while(name[i]!=NULL)
{
key2+=(int)name[i];
i++;
}
key2=key2%20;
}
node* input()//输入节点
{
node*temp;
temp= new node;
temp->next=NULL;
cout<<"输入姓名:"<<endl;
cin>>temp->name;
cout<<"输入地址:"<<endl;
cin>>temp->address;
cout<<"输入电话:"<<endl;
cin>>temp->num;
return temp;
}
int apend()//添加节点
{
node*newphone;
node*newname;
newphone=input();
newname=newphone;
newphone->next=NULL;
newname->next=NULL;
hash(newphone->num);
hash2(newname->name);
newphone->next= phone[key]->next;
phone[key]->next=newphone;
newname->next= nam[key2]->next;
nam[key2]->next=newname;
return 0;
}
void create()//新建节点
{
int i;
phone=new pnode[20];
for(i=0;i<20;i++)
{
phone[i]=new node;
phone[i]->next=NULL;
}
}
void create2()//新建节点
{
int i;
nam=new mingzi[20];
for(i=0;i<20;i++)
{
nam[i]=new node;
nam[i]->next=NULL;
}
}
void list()//显示列表
{
int i;
node*p;
for(i=0;i<20;i++)
{
p=phone[i]->next;
while(p)
{
cout<<p->name<<'_'<<p->address<<'_'<<p->num<<endl;
p=p->next;
}
}
}
void list2()//显示列表
{
int i;
node*p;
for(i=0;i<20;i++)
{
p=nam[i]->next;
while(p)
{
cout<<p->name<<'_'<<p->address<<'_'<<p->num<<endl;
p=p->next;
}
}
}
void find(char num[11])//查找用户信息
{
hash(num);
node*q=phone[key]->next;
while(q!= NULL)
{
if(strcmp(num,q->num)==0)
break;
q=q->next;
}
if(q)
cout<<q->name<<"_"<<q->address<<"_"<<q->num<<endl;
else cout<<"无此记录"<<endl;
}
void find2(char name[8])//查找用户信息
{
hash2(name);
node*q=nam[key2]->next;
while(q!= NULL)
{
if(strcmp(name,q->name)==0)
break;
q=q->next;
}
if(q)
cout<<q->name<<"_"<<q->address<<"_"<<q->num<<endl;
else cout<<"无此记录"<<endl;
}
void save()//保存用户信息
{
int i;
node*p;
for(i=0;i<20;i++)
{
p=phone[i]->next;
while(p)
{
fstream iiout("out.txt", ios::out);
iiout<<p->name<<"_"<<p->address<<"_"<<p->num<<endl;
p=p->next;
}
}
}
void menu()//菜单
{
cout<<"0.添加记录"<<endl;
cout<<"3.查找记录"<<endl;
cout<<"2.姓名散列"<<endl;
cout<<"4.号码散列"<<endl;
cout<<"5.清空记录"<<endl;
cout<<"6.保存记录"<<endl;
cout<<"7.退出系统"<<endl;
}
int main()
{
char num[11];
char name[8];
create();
create2();
int sel;
while(1)
{
menu();
cin>>sel;
if(sel==3)
{ cout<<"9号码查询,8姓名查询"<<endl;
int b;
cin>>b;
if(b==9)
{ cout<<"请输入电话号码:"<<endl;
cin>>num;
cout<<"输出查找的信息:"<<endl;
find(num);
}
else
{ cout<<"请输入姓名:"<<endl;
cin>>name;
cout<<"输出查找的信息:"<<endl;
find2(name);}
}
if(sel==2)
{ cout<<"姓名散列结果:"<<endl;
list2();
}
if(sel==0)
{ cout<<"请输入要添加的内容:"<<endl;
apend();
}
if(sel==4)
{ cout<<"号码散列结果:"<<endl;
list();
}
if(sel==5)
{ cout<<"列表已清空:"<<endl;
create();
create2();
}
if(sel==6)
{ cout<<"通信录已保存:"<<endl;
save();
}
if(sel==7) return 0;
}
return 0;
}
数据库表中电话号码字段用什么属性
推荐用varchar,char的长度是固定的,而varchar的长度是可以变化的,比如,存储字符串“abc",对于char(10),表示你存储的字符将占10个字节(包括7个空字符),而同样的varchar(10)则只占用3个字节的长度,10只是最大值,当你存储的字符小于10时,按实际长度存储,如果数据量很大的话,可以节省很大的存储空间
千万不要用int这类的,因为电话号码开头的0是存不住的,造成数据丢失,那损失就大了。
数据库中电话号码的字段名是什么
数据库中电话号码的字段名是什么,数据库字段的命名必须遵循以下规范:
采用有意义的字段名。字段的名称必须是易于理解,能表达字段功能的英文单词或缩写英文单词,单词首字母必须大写,一般不超过三个英文单词。例如:人员信息表中的电话号码可命名为:Telephone或Tel。产品明细表中的产品名称可用ProductName表示。(推荐一般用完整的英文单词)。
系统中所有属于内码字段(仅用于标示唯一性和程序内部用到的标示性字段),名称取为:“ID”,采用整型或长整型数,具体根据可能的数据量确定,增加记录时取最大值加
安卓系统的电话号码存在哪个文件夹里
在系统文件夹里面一般看不到,安卓和苹果手机号码的位置如下:
安卓手机号码存放位置:data/data/com.android.provides.contacts/(可以使用RE文件管理器打开),苹果手机号码存放位置:/var/mobile/containers/bundle/application。
手机电话号码是存在手机系统文件夹,连接电脑是看不见的,可通过第三方软件进行备份,也可以通过PC套件备份用手机进入名片夹,选项-标记-标记全部-选项-复制-复制到储存卡,备份文件在e/other/contact(在手机上显示的是其他/名片夹)。
扩展资料:中国移动号段:134、135、136、137、138、139、150、151、152、157、158、159、147、182、183、184、187、188、1705、178。
中国联通号段:130、131、132、145(145属于联通无线上网卡号段)、155、156、185、186、176、1709、171、166。
中国电信号段:133、153、180、181、189、1700、177、173。
与联通合作的虚拟运营商号段:1709、1708、1707、1718、1719开头;另:1713、1715、1716、 1717开头新号段正在配置中,暂未开通。
关于电话号码数据库到此分享完毕,希望能帮助到您。